Git Operations
Every thread is a full git clone on its own branch. Tarsk provides a built-in Git Ops panel so you can commit, push, and fetch without leaving the app.
The Branch Bar
Section titled “The Branch Bar”At the top of every thread view, the branch bar displays:
- The current branch name (e.g.
add-login-page) - Your local git username
This is a quick confirmation that you’re on the right branch before committing.
The Git Ops Button
Section titled “The Git Ops Button”The Git Ops button in the top toolbar opens a dropdown menu with all git operations. The button also shows a status indicator:
- No dot — no uncommitted changes
- Orange dot — uncommitted changes exist
- Green dot — changes committed but not yet pushed
Available Operations
Section titled “Available Operations”| Operation | Description |
|---|---|
| Commit | Stage all changes and commit with a message |
| Push | Push the current branch to origin |
| Fetch | Fetch from origin to see if the remote has new commits |
| Sync Branch | Pull the latest changes from the default branch via rebase |
| Revert File | Restore a specific file to its last committed state |
| Checkpoint | Snapshot current changes so they can be restored later |
| View Diff | Open the diff viewer to review all changes |
| Git History | View the commit log for this branch |
| Create Repo | Create a new GitHub repository from this thread |
Committing Changes
Section titled “Committing Changes”- Click Git Ops → Commit.
- The commit dialog shows the number of changed files.
- Enter a commit message, or click Generate to have the AI write a conventional commit message based on the diff.
- Click Commit.
All modified and new files are staged automatically (git add -A) before committing.
AI-Generated Commit Messages
Section titled “AI-Generated Commit Messages”The Generate button sends the current diff to the AI model and returns a commit message following the conventional commits format (e.g. feat(auth): add JWT refresh token endpoint). You can edit the generated message before committing.
Pushing Changes
Section titled “Pushing Changes”- Click Git Ops → Push.
- Tarsk runs
git push -u origin <branch>to push the branch and set the upstream tracking reference. - A success message confirms the push.
If the push fails because the remote has commits you don’t have locally (non-fast-forward), run Fetch first, then resolve any conflicts before pushing again.
Fetching from Origin
Section titled “Fetching from Origin”Click Git Ops → Fetch to run git fetch origin. This updates your local knowledge of what’s on the remote without modifying your working tree or current branch. Use this to check whether the remote has new commits before pushing.
Creating a GitHub Repository
Section titled “Creating a GitHub Repository”If the thread doesn’t have a remote origin yet (e.g. you scaffolded a new app), you can create a GitHub repository directly:
- Click Git Ops → Create Repo.
- Enter the repository name and visibility (public/private).
- Click Create.
Tarsk runs gh repo create --source . --push, which creates the repository on GitHub, sets it as the remote origin, and pushes the current branch.
Viewing Git History
Section titled “Viewing Git History”Click Git Ops → Git History to open a log of commits on this branch, showing:
- Commit hash (short)
- Commit message
- Author name
- Date
This is useful for reviewing what the agent has committed across a long work session, or for finding a previous state you want to return to.
Syncing with the Default Branch
Section titled “Syncing with the Default Branch”Click Git Ops → Sync Branch to pull the latest changes from the default branch (usually main or master) into your thread’s branch using rebase. This keeps your feature branch up-to-date with the latest work on the default branch without creating a merge commit.
Sync Branch automatically:
- Pushes any unpushed commits on your thread’s branch first (if the branch has diverged)
- Runs
git pull --rebase origin <default-branch>to replay your commits on top of the latest default branch
If rebase conflicts occur, you will need to resolve them manually. Open the thread directory in your IDE to handle conflicts, then continue the rebase.
Reverting a Single File
Section titled “Reverting a Single File”If the agent made changes to a file that you want to undo, you can revert just that file without affecting other changes:
- Open the Review tab (or Git Ops → View Diff).
- Find the file you want to revert.
- Click the Revert button on that file’s diff.
Tarsk restores the file to its last committed state (HEAD). For untracked or newly staged files, the file is deleted from disk entirely.
Checkpoints
Section titled “Checkpoints”A checkpoint is a snapshot of the working tree at a point in time. Checkpoints let you save your current state before asking the agent to make risky or experimental changes, and then restore back to that state if the results are not what you wanted.
Creating a Checkpoint
Section titled “Creating a Checkpoint”Checkpoints are created automatically by the agent before it begins making changes. They can also be triggered manually from the UI. The checkpoint uses git stash internally, so it captures both tracked and untracked changes without committing them.
Restoring a Checkpoint
Section titled “Restoring a Checkpoint”If the agent’s changes are unsatisfactory, you can restore a previous checkpoint:
- Click Git Ops → Restore Checkpoint.
- Select the checkpoint to restore (each is labeled with the message ID it was created before).
- Tarsk discards all current working tree changes and applies the checkpoint’s snapshot.
This is a destructive operation — all uncommitted changes since the checkpoint will be lost.
Commit Method
Section titled “Commit Method”Whether changes are committed directly to the branch or converted into a pull request is controlled by the project’s Commit Method setting:
direct— commits and pushes to the thread’s branch; you handle PRs manuallypull-request— after committing and pushing, automatically creates a GitHub pull request (see Review & Pull Requests)
Change this in Project Settings.