Files
Use Git
Use Git and GitHub with agents, review commits, and keep repository history alongside TimeTravel.
What Git is for
Git tracks deliberate versions of a repository: commits, branches, remotes, and reviews. Use it when you need portable history, collaboration with external tools, or a clean release record.
Use Git in a project
- Open a terminal in the project.
- Clone a repository or run
git init. - Configure remotes and credentials as needed.
- Commit meaningful changes.
- Push or pull through the terminal, file tools, or Git browser.
Store deploy keys and access tokens using project secrets or SSH keys, not inside the repository.
Let an agent work with GitHub
On a site with the GitHub connector configured, you can give a named Codex or supported Claude Code agent access to your GitHub repositories without pasting a token into its chat. The project needs internet access.
- Open Settings -> Connectors and connect GitHub. Complete GitHub's sign-in and choose the repositories accessible to the site's GitHub App.
- In the agent's message box, open Connectors, choose GitHub, select your connection, turn it on for that agent, and choose Save. Connecting your account alone does not enable it for every agent.
- Ask the agent to inspect a repository you can access. For example: "Read OWNER/REPO and summarize its open pull requests. Do not change files or publish anything."
- Review the repository and pull-request links in the response before asking the agent to make changes.
During that agent's turn, the supplied gh and git commands use your
GitHub connection. The agent can run gh auth status to check that it reports
"signed in via the CoCalc GitHub connector", then use ordinary commands such
as gh pr list --repo OWNER/REPO. GitHub SSH-style remotes work through
HTTPS with this connector, without a separate SSH key.
Use the connection from the agent chat. If its menu says Codex and Claude only, the selected agent runtime does not support the connector; choose a Codex or supported Claude Code agent. If the agent cannot read a repository, check the selected GitHub connection, the repositories selected for it, and the project's internet access. Ask the agent to report the connector status before trying a separate login or changing the project's Git setup.
When the connector is unavailable on your site, use the project's own Git credentials instead. In either case, review the diff and decide when the agent should push, create a pull request, or make other public changes.
Set up and commit from a Codex thread
Open the Codex thread's menu and choose Git browser. On phones, open
Chat tools using the ellipsis button, then choose Thread actions
to open the thread menu. Check the displayed
repository path before using its actions. If the folder is not a repository,
Initialize Git Repo creates one. Ask Agent to Set Up Repo asks the thread's
agent to initialize it, choose a .gitignore, stage appropriate source files,
make the first commit, and summarize inclusions and exclusions.
In the commit selector, choose HEAD (Uncommitted changes (git diff HEAD)) to open Commit changes, then inspect Uncommitted files:
- Commit with a message runs
git commit -adirectly with that message. - Commit with an empty message asks the agent to create the commit.
- Commit with AI Summary asks the agent to commit and write the message; if you supplied text, the prompt requests that text as the first line.
These actions include all tracked changes, not only the file currently shown.
Untracked files are excluded. Use Add beside an untracked file when it should
be included, or Ignore when it belongs in .gitignore; review the resulting
file list before committing. Agent actions need an available Codex thread.
After an agent request, inspect its response and the resulting commit in the Git browser. Sending the request is not proof that a commit succeeded. Review commits and use TimeTravel for file-level recovery as described below.
Transfer saved Git review notes
In the Git browser's commit drawer, open the Review actions ellipsis menu. Export reviews downloads a JSON bundle of saved commit reviews from your account. Its scope is the account's review store, not only the repository or commit currently displayed. Confirm that notes are saved and inspect the bundle before sharing it; unsaved browser drafts are not the export source.
On the receiving account, use Review actions -> Import reviews and select the JSON file. Imported records belong to that signed-in account. They are not shared ownership of the sender's notes. The import keeps an existing record when its update time is equal to or newer than the imported one, and skips invalid records. Check the reported imported/skipped counts and inspect the intended commit's notes afterward.
The bundle transfers review notes and state, not the repository or access to it. Include the repository location and full commit id in your handoff, and confirm that the recipient can open that commit separately. Export/import does not push commits or submit a GitHub review.
Git and TimeTravel
Git and TimeTravel solve different problems. Git is for intentional repository history. TimeTravel is for file-focused recovery and inspection. When a file is in Git, TimeTravel can also make Git revisions easy to browse with a slider, and the Git browser is available when you need full commit context.
Why this matters in CoCalc
CoCalc projects are full Linux environments, so Git works like it does on a normal machine. The difference is that Git is integrated into a collaborative, browser-accessible workspace with terminals, notebooks, TimeTravel, and agents.