GigaGit gg

A fast terminal git client for very large monorepos

GitKraken's one-key smart operations with lazygit's keyboard-driven TUI. Huge repos make ordinary git slow and stateful operations error-prone — gg turns multi-step flows (pull-with-divergence, switch-with-local-changes, worktree create-and-cd) into single keystrokes that ask you a focused question only when there's a real decision to make. Cross-platform, shells out to the system git.

View on GitHub Watch on YouTube Install

How do I…? — recipes & demos

Every question below links to a written recipe — the exact keys, step by step — under the demo video that shows it. Follow the steps without watching, or watch when you want to see it happen. Every question and every demo title is a link you can share.

The tour

Panels for branches, worktrees, files, staged changes and commits — with a contextual footer that lists only the keys that apply to the focused panel right now.

What does the gg screen show?

  1. Run gg inside any git repository.
  2. The left column holds Branches (top), Files (your changed files) and Staged below it; the right side is the commit graph.
  3. tab moves focus between panels; ctrl+← / ctrl+→ switches the tabs inside a box (Branches / Remotes / Worktrees, Files / Tags, Staged / Reflog).
  4. The footer lists only the keys that apply to the focused panel right now.

How do I browse commit history and see what a commit changed?

  1. Focus the commit graph (→ or tab) and move with ↓ / ↑.
  2. enter on a commit opens its changed files; enter on a file shows the diff.
  3. esc backs out of any view, one level at a time.

Plain git: git log, git show <commit>

How do I see all keyboard shortcuts in gg?

  1. Press ? for the full key reference; esc closes it.
  2. . opens the action menu for whatever is under the cursor — type to filter it.
  3. ctrl+p is the command palette for everything that has no key of its own. q quits gg.

Stage & commit

Stage files with space, commit with c — title and multi-line description in one popup, ctrl+s commits.

How do I stage files and commit?

  1. Press tab to focus the Files panel.
  2. Put the cursor on a file and press space to stage it. Repeat for every file that belongs in the commit.
  3. Press c. The commit popup has a title and a multi-line description — tab switches between them.
  4. Press ctrl+s to commit (esc cancels). The new commit appears at the top of the graph.

Plain git: git add <file> then git commit

How do I unstage a file?

  1. Focus the Staged panel, put the cursor on the file and press space. It moves back to Files; your edits stay in the working tree.

Plain git: git restore --staged <file>

Smart branch switch

Switch with s. Local changes in the way? gg offers a worktree for the branch, an autostash carry-over, or a clean cancel — never a dead-end error.

How do I create a new branch?

  1. On the Branches panel, put the cursor on the branch to start from (e.g. main) and press b.
  2. Type the name and press enter. The cursor stays on the source branch — the new one is one row up.
  3. Use B instead of b to create the branch and switch to it in one go.

Plain git: git branch <name> / git switch -c <name>

How do I switch branches when I have uncommitted changes?

  1. On the Branches panel, select the branch and press s, then confirm.
  2. With local changes in the way, gg asks instead of failing: open the branch in a worktree (default), carry the changes along, or cancel.
  3. If the branch is already checked out in another worktree, gg offers to jump to that worktree instead.

Plain git: git switch <branch> (fails with local changes), git stash + switch + git stash pop

Undo the last commit

u soft-resets the last commit, ref-only — your files stay staged and nothing is lost.

How do I undo my last commit?

  1. Press u — from any panel, no confirmation. The last commit is undone with a soft, ref-only reset.
  2. Your changes are back on the Staged panel, nothing lost. Fix them and commit again with c, or leave them staged.
  3. Changed your mind? ctrl+p → Branch versions… holds the snapshot gg took before the undo — r restores it.

Plain git: git reset --soft HEAD~1

Undo anything

The reflog tab recovers what git seems to have forgotten — reset to an entry, check it out, bookmark or shelf it, even for dangling commits.

How do I get a branch back to how it was before an amend, undo or rebase?

  1. gg snapshots a branch before every operation that rewrites, replaces or deletes it.
  2. Press ctrl+p, type branch versions and pick Branch versions….
  3. Choose the branch, then the version from before the operation (the list says which operation each snapshot preceded).
  4. Press r to reset the branch to it and confirm.

Plain git: digging through git reflog and git reset --hard <sha>

Where is the reflog in gg, and what can I do with an entry?

  1. Focus the bottom box of the left column (the Staged panel) and press ctrl+→ — it flips to the Reflog tab.
  2. Every HEAD move is listed, newest first, including commits no branch points at any more.
  3. . on an entry offers: reset to it, check it out, bookmark it, or put it on the shelf. See Recover after reset --hard.

Plain git: git reflog

One-key worktrees

w creates a worktree for the selected branch in the sibling <repo>.worktrees/ container; W creates and switches in one flow.

How do I work on a hotfix without stashing my current changes?

  1. On the Branches panel, press b to create the hotfix branch (or select an existing one).
  2. With the cursor on that branch, press W and enter: gg creates a worktree for it and switches into it in one flow (in <repo>.worktrees/<branch>). w creates it without switching.
  3. You are now in a clean second checkout; your dirty main worktree is untouched — nothing was stashed.

Plain git: git worktree add ../hotfix fix/render-crash + cd

How do I go back to the worktree where my branch is checked out?

  1. On the Branches panel, select the branch (e.g. main) and press s — gg sees it is checked out in another worktree and offers to jump there; press enter.
  2. ctrl+s on the branch jumps straight to its worktree without asking.

How do I delete a worktree but keep the branch?

  1. Press ctrl+→ on the top-left box until the Worktrees tab shows.
  2. Select the worktree, press d and confirm. The directory goes; the branch and its commits stay.

Plain git: git worktree remove <path>

Linux-kernel scale

Built for very large monorepos: the UI stays responsive on repos the size of the Linux kernel, loading history in pages as you scroll.

Does gg stay fast on a huge repository like the Linux kernel?

  1. Yes — it opens the 1.46-million-commit Linux kernel with no spinner, because history loads in pages as you scroll.
  2. On the commit graph, ctrl+l loads the next batch on demand (300, 600, 900 commits…) without freezing.

How do I filter commits by author, path, message or date?

  1. Focus the commit graph and press \ — the commit feed filter opens.
  2. Fill in any of path, author, message text, since / until (tab moves between fields), then enter.
  3. Press \ again to change it. To clear it, use . → Clear filter, or erase all fields in the popup.

Plain git: git log --author=<name> -- <path>

Delete & restore a branch

Delete a branch with d — and get it back when you change your mind: recovery works even after the branch is gone.

How do I delete a branch?

  1. On the Branches panel, select the branch, press d and confirm.
  2. If it has unmerged commits, gg warns you; confirm again to force-delete.

Plain git: git branch -d <branch> / git branch -D <branch>

How do I recover a deleted branch?

  1. Press ctrl+p, type branch versions and pick Branch versions… — deleted branches are listed too.
  2. Select the deleted branch, press enter to see its versions.
  3. Press r on the version and confirm: the branch is back, commits and all.

Plain git: find the tip in git reflog, then git branch <name> <sha>

Resolve a merge conflict

x opens the conflict process: every conflicted file in one list, your side and theirs region by region with the assembled result underneath. Keep ours here, take theirs there, apply — gg writes the file, marks it resolved and stages it.

How do I merge a branch into main?

  1. On the Branches panel press m on the branch to merge, then m on main. The order sets the direction: the first branch you mark is merged into the second.
  2. gg offers what you can do with the pair: Merge, Rebase, Interactive rebase, Fast-forward (when possible), Compare.
  3. Pick Merge and press enter.

Plain git: git switch main && git merge <branch>

How do I resolve a merge conflict?

  1. When a merge conflicts, gg asks: keep the conflicts and resolve them (default), or abort the merge. Keep them.
  2. Press x — the conflict window lists every conflicted file. C keeps our side of the whole file.
  3. For finer work press enter on a file: the line editor shows our side left, theirs right, region by region, with the result live underneath.
  4. c keeps our lines for the current region, i takes theirs, n jumps to the next region.
  5. ctrl+s writes the file, marks it resolved and stages it.
  6. Press c to continue the merge — gg writes the merge commit.

Plain git: edit the <<<<<<< markers, git add, git merge --continue

How do I abort a merge, rebase or cherry-pick that has conflicts?

  1. Right after the conflict, gg's first question already offers Abort.
  2. Later, press x — a paused operation shows ⏸ … press [x] to continue or abort in the status bar, and x offers both.

Plain git: git merge --abort / git rebase --abort

Interactive rebase

Reorder, squash and drop commits as rows: ctrl+arrow moves one, s squashes it into the commit it belongs to, d drops the junk, enter runs it. No rebase -i, no editor, no todo file.

How do I squash, drop or reorder commits (interactive rebase)?

  1. On the Branches panel press m on your branch, then m on its base (e.g. main).
  2. Pick Interactive rebase and press enter. Your commits are listed as rows — no todo file, no editor.
  3. ctrl+↓ / ctrl+↑ moves a commit; s squashes it into the commit below (messages combined); d drops it. Pick and reword are there too.
  4. Press enter to run the rebase.

Plain git: git rebase -i main

How do I push a branch after rewriting its history?

  1. A plain push is refused after a rebase or amend. Press ., type force.
  2. gg offers force-with-lease first: it refuses if the remote moved since your last fetch, so you can't overwrite a teammate's work. Plain force is there too. See Force push safely.

Plain git: git push --force-with-lease

Worktrees for AI agents

One isolated checkout per agent — gg worktree add --branch agent-1 --hook runs a post-create hook to prepare it, and the Worktrees tab shows every checkout at once. gg also speaks MCP (gg mcp), so an agent can drive the client itself.

How do I give each AI coding agent its own worktree?

  1. Run gg worktree add --branch agent/parser-crash --hook — one worktree and branch per agent.
  2. --hook runs the post-create hook committed in the repo's .gg.toml, so each checkout is prepared (dependencies, env files) before the agent starts.
  3. Open gg: all agents' branches show in one graph, and the Worktrees tab (ctrl+→ on the top-left box) lists every checkout.

How do I review another branch without switching to it?

  1. On the Branches panel, enter on the branch jumps to its newest commit in the graph — your working tree is not touched.
  2. enter again opens that commit's files and diffs.
  3. Happy with it? esc, then m on the branch, m on main, and merge. Other worktrees keep working, isolated.

Discard safely

d discards a file's edits (keeping any staged hunks) after a confirmation modal; D discards all unstaged changes.

How do I discard changes to one file?

  1. On the Files panel, select the file; enter previews the diff (esc back).
  2. Press d and confirm. Only that file is reverted — other edits stay.
  3. This cannot be undone. If you might want it back, first . → Add to shelf (see Bookmarks & the shelf).

Plain git: git restore <file>

How do I discard all local changes?

  1. On the Files panel press D and confirm. Every unstaged edit is reverted and every new file deleted.

Plain git: git restore . && git clean -fd

A free GitKraken alternative

The merge-conflict editor, per-repo identity and commercial use — free, in your terminal, even over SSH. And it isn't Electron: the same client opens the Linux kernel's 1.46 million commits instantly.

Is there a free GitKraken alternative with a merge conflict editor and multiple profiles?

  1. gg is free, commercial use included: conflict editor (how), interactive rebase (how) and multiple identity profiles.
  2. It runs in the terminal (also over SSH) and isn't Electron — it opens the Linux kernel instantly.

How do I use a different git name and email per repository (work / open source)?

  1. Press , for settings and open Identity & profiles.
  2. It shows the global identity, this repo's identity, and the profile that would apply.
  3. Create named profiles (e.g. work, oss) and switch a repo to one with a single key.

Plain git: git config user.name / user.email (global vs --local)

Amend the last commit

C opens the amend popup with the current message already in the field; ctrl+s saves it. gg snapshots the branch before it rewrites anything, so ctrl+p → Branch versions lists the amend and r restores the commit exactly as it was.

How do I change the last commit message?

  1. Press C. The commit popup opens with the last commit's message already filled in.
  2. Edit it and press ctrl+s. The commit is rewritten with the new message.

Plain git: git commit --amend

How do I add a forgotten file to the last commit?

  1. Stage the file (space on the Files panel), press C, then ctrl+s — the amend folds in whatever is staged.

Plain git: git add <file> && git commit --amend --no-edit

How do I undo an amend?

  1. gg saved a version of the branch before the amend: ctrl+p → Branch versions…, pick the pre-amend version, r restores the old commit.

Committed to the wrong branch

u undoes the commit and hands the work back staged, b creates the branch it should have gone to, s switches and offers to carry the changes with you. Same work, right branch — no reset --hard, no cherry-pick dance.

I committed to the wrong branch — how do I move the commit to another branch?

  1. Press u to undo the commit. The work comes back staged and main is clean again.
  2. On the Branches panel select main, press b, type the new branch name and enter. The cursor stays on main — the new branch is one row up.
  3. Move up to the new branch and press s. Because you have uncommitted changes, gg offers a worktree, carrying the changes, or cancel — pick carry the changes (one row down; worktree is the default).
  4. The carried changes arrive unstaged: on the Files panel press space to stage them, then c, the message, and ctrl+s.

Plain git: git reset --soft HEAD~1, git switch -c <branch>, git commit

Cherry-pick a commit

Put the cursor on the commit, press ., filter for cherry — it replays onto the branch you're standing on and the branch it came from is untouched. No hashes copied between terminal windows.

How do I cherry-pick a commit from another branch?

  1. Make sure you are on the branch that should receive the commit.
  2. Focus the commit graph — it shows commits from all local branches — and put the cursor on the commit you want.
  3. Press ., type cherry, choose Cherry-pick here and enter. The commit is replayed onto your current branch; the source branch is untouched.

Plain git: git cherry-pick <sha>

Stash vs shelf

s opens a stash with a name field and a checkbox per file, S lists them. The shelf lives in gg's own state outside the repo, so it survives resets, branch deletes and gc — stash for "later today", shelf for "don't lose this".

How do I stash only some of my files?

  1. On the Files panel press s. The stash popup takes a name and shows every changed file as a checkbox.
  2. space unticks the files you want to keep working on.
  3. ctrl+s stashes only the ticked files; the rest stay in your working tree.

Plain git: git stash push -- <file>…

How do I apply, pop or drop a stash?

  1. Press S to open the stash list; enter shows a stash's files.
  2. On a stash press . — apply, pop or drop. S again closes the list.

Plain git: git stash apply / pop / drop

What is the difference between a stash and gg's shelf?

  1. A stash lives inside the repository: a hard reset or a deleted branch can take it with them. Use it for “later today”.
  2. The shelf keeps a frozen copy of a file in gg's own state, outside the repository — it survives discards, resets and branch deletes, and is shared by all worktrees of the repo. Use it for “don't lose this”.
  3. Add a file with . → Add to shelf; open the shelf with G; p restores an entry.

Force push safely

A rejected non-fast-forward push becomes a choice — rebase onto their commits, force-push over them, or abort — with rebase as the default. When you genuinely must rewrite the remote, force-with-lease is offered first.

My push was rejected (non-fast-forward) — what do I do?

  1. Press P to push. When the remote has commits you don't, git refuses; gg checks why and turns the refusal into a choice.
  2. Pick rebase onto theirs (the default), force-push over them, or abort.
  3. enter rebases your commits on top of theirs and pushes in one step — nobody's work is lost.

Plain git: git pull --rebase && git push

How do I force push safely?

  1. Press ., type force.
  2. Choose force-with-lease (offered first): it refuses if the remote moved since your last fetch. Plain force is available, but you have to choose it on purpose.
  3. esc closes without pushing anything.

Plain git: git push --force-with-lease

AI commit message

ctrl+g in the commit popup hands your staged diff to the AI agent you already use and writes an editable draft back. gg ships no model and doesn't phone home: it runs the command you configured, approval-gated and shown in full first.

How do I generate a commit message with AI?

  1. You need an AI agent command configured in gg (Claude Code or any CLI agent) — gg ships no model of its own; see the README.
  2. Stage your changes and press c (or C to amend).
  3. Press ctrl+g. gg asks which agent and how to run it — the headless command is preselected; enter.
  4. The first run shows the exact command for approval; gg remembers the answer for this repo until the command changes. enter.
  5. The agent reads the staged diff and recent commit subjects and writes a draft into the editable fields. Fix it if you like, then ctrl+s.

AI code review

gg review main..my-branch — or . → Review branch — hands the diff to your configured agent and prints file-and-line findings, saved under gg's state directory. No service, no upload, no pull request required.

How do I get an AI code review of my branch before opening a PR?

  1. Run gg review main..my-branch. gg hands the diff to your configured agent — no service, no upload, no pull request needed.
  2. You get a summary and verdict, then each finding pinned to a file and line.
  3. The review is stored as a note on the reviewed commit, so it's still there tomorrow.

How do I start an AI review from inside gg?

  1. On a commit or branch press ., type review, enter.
  2. Choose the agent and how it runs: interactively in a terminal, or headless in the background.
  3. Approve the exact command. A headless review runs in the background; the status line counts running tasks.

How do I read a review's findings next to the code?

  1. Reviewed commits wear a ✎ in the graph. On the Branches panel, enter jumps to the branch tip.
  2. enter lists the commit's files with its reviews on top; open a review for its overview and each file's note count.
  3. enter on the overview shows the summary and verdict; open a file to see each finding boxed under the line it is about.

AI resolves a conflict

x then t puts your agent in the external-tool picker next to your mergetool: it resolves every file, stages it and continues the merge through further rounds, then gg opens the agent's own overview for you to check. It never aborts and never pushes.

How do I let an AI agent resolve a merge conflict?

  1. Start the merge as usual and keep the conflicts (see Resolve a merge conflict).
  2. Press x for the conflict window, then t — the external tool picker.
  3. Choose Resolve & complete with an agent…, pick the agent and how to run it, and approve the exact command.
  4. The agent resolves every file, stages them and continues the merge itself. It never pushes and never aborts.
  5. gg then opens the agent's overview — which files, how each was resolved — for you to check.

Bookmarks & the shelf

A bookmark is a pointer — . → Bookmark this file, then g to jump back to it. The shelf stores the content in gg's own state rather than the repository, so G still finds a file you discarded outright and p restores it.

How do I bookmark a file so I can jump back to it?

  1. On any file, press ., type bookmark, choose Bookmark this file.
  2. Press g from anywhere to open the bookmarks: enter jumps to the file, p pastes it into the working tree, y copies its path.

How do I keep a copy of a file before I discard or reset it?

  1. On the file press ., type shelf, choose Add to shelf — a frozen copy of its content.
  2. Discard, reset or delete the branch as you like: the shelf lives in gg's own state for this repo, outside git's reach.
  3. Press G to open the shelf, p to restore an entry, choose where it lands (the original path by default); gg asks before overwriting a file on disk.

Patches between machines

gg commit export-patch my-branch --out file.patch writes a real git am-able mailbox; gg apply --am file.patch recreates the commit on the other side with author and date intact — atomically, rolling back instead of leaving you half-applied.

How do I move a commit to another machine without a shared remote?

  1. Export it: gg commit export-patch <revision> --out ../fix.patch — a git am mailbox with author, date, message and a binary-safe diff (without --out it is <shortsha>.patch beside the repo).
  2. Copy the file any way you like: e-mail, scp, USB stick.
  3. On the other machine run gg apply --am ../fix.patch. The commit is recreated with its author and date; if the patch doesn't fit, it is rolled back entirely.

Plain git: git format-patch -1 <sha> / git am <file>

Getting started

The whole first run: install the single binary, type gg in any repository, tab to move focus, space to stage a file, c to open the commit box, ctrl+s to commit — and ? for the key list.

How do I install gg?

  1. Homebrew: brew install homeend/tap/gg — or go install github.com/homeend/gigagit/cmd/gg@latest, or download a release from GitHub.
  2. Check it with gg --version. No daemon, no account, no config file needed. gg uses the git on your PATH.

How do I make my first commit with gg?

  1. Type gg inside any repository.
  2. tab to the Files panel, space stages a file, c opens the commit box, type the message, ctrl+s commits.
  3. Lost? ? shows every key, and the footer only shows the keys that apply right now.

gg in 15 features

Fifteen things gg does, in one unbroken take on a real repository — a worktree per task, one-key undo, AI commit messages, branch versions, the conflict process, interactive rebase, the Linux kernel's 1.46M commits and gg mcp.

What can gg do?

  1. Worktrees per task from the command line, with a post-create hook — how.
  2. One screen: branches, files, staged and the graph — tour. Stage with space, commit with c — how.
  3. u undoes the last commit — how; ctrl+g writes the message with your AI agent — how.
  4. Branch versions: every branch gg touches can be restored — how.
  5. Stash with a checkbox per file — how; the Worktrees tab — how.
  6. m + m pairs two branches for merge, rebase, interactive rebase or compare; x resolves conflicts — merge, rebase.
  7. The same speed on the Linux kernel — scale; and your coding agent can drive it over MCP — how.

Stage part of a file

git add -p as a screen instead of a prompt: H on the Files panel opens the file hunk by hunk, i takes the working side and c the index side, n/p move between them, and a pane previews the assembled result live. enter touches only the index — H on Staged gives you the mirror picker that unstages.

How do I stage only part of a file?

  1. On the Files panel, put the cursor on the file and press H. The staging picker opens: index on the left, working tree on the right, nothing ticked yet.
  2. Press i to take the working side of the hunk under the cursor; n jumps to the next hunk (p back). A hunk you never tick is left out.
  3. For single lines, move with ↑/↓ (←/→ switch side) and tick them with space.
  4. Press ctrl+s to apply. Only the index changes — the file now shows in both Files and Staged.
  5. H on the Staged panel opens the mirror unstage picker (staged ↔ HEAD). Commit with c … ctrl+s; the rest stays in your working tree.

Plain git: git add -p

Pull without losing local work

p asks before anything moves, with No preselected, then names the fork instead of failing at you — rebase, merge, reset or abort, with the destructive one labelled destructive. Rebase still wants a clean tree and gg doesn't pretend otherwise: s stashes with a name and a checkbox per file, S pops it back.

git pull refuses because my branch and the remote diverged — how do I pull?

  1. Press p. gg asks first — the highlighted answer is No, so a stray key can't touch your tree; choose Yes.
  2. gg names the situation (e.g. main has diverged from origin) and offers rebase, merge or reset. The option that throws work away says so in its title.
  3. Pick rebase for a straight line (your commits on top of theirs), or merge to keep both lines.

Plain git: git pull --rebase or git pull --no-rebase

How do I pull without losing my local changes?

  1. Rebasing a diverged branch needs a clean tree, so put your edits aside first: tab to Files, s, choose the files, ctrl+s. (If the pull is blocked because files would be overwritten, gg offers to shelve them for you — see Pull blocked by local changes.)
  2. Press p again and choose rebase.
  3. Press S for the stash list, ., type pop, enter — your edits are back exactly as you left them.

Plain git: git stash && git pull --rebase && git stash pop

Revert a commit

The commit you need gone isn't the last one. enter on any commit in the feed shows the actual diff, . opens its action menu, and Revert writes a new commit with the exact inverse. Everything after it stays where it is and nothing is rewritten — which is why revert is the undo you can push.

How do I undo an older commit that was already pushed?

  1. Focus the commit graph and put the cursor on the commit to undo.
  2. enter opens its files and enter again its diff, so you know what you are reverting; esc back.
  3. Press ., type revert (the whole word — rev also matches Review), enter.
  4. A new commit appears at the top applying the inverse. Nothing was rewritten, so it is safe to push.

Plain git: git revert <sha>

Should I use revert or reset?

  1. Reset moves the branch backwards — every commit after the target goes too, and if you already pushed you rewrite shared history.
  2. Revert adds a new commit that undoes one change; history stays intact. Use it for anything pushed. For the last, unpushed commit u (undo) is simpler.

Rebase vs merge

The same two branches, run both ways, on one graph. m marks each branch and the pair menu offers Merge, Rebase, Interactive rebase or Compare — mark order sets the direction. Merge writes a merge commit; ctrl+p → Branch versions → r puts the branch back; rebase re-makes the same changes as new commits in a straight line.

What is the difference between rebase and merge?

  1. Merge joins the two lines with a merge commit: the fork stays visible, nothing is rewritten — safe on anything pushed.
  2. Rebase replays your commits on top of the other branch (new shas, same changes) for one straight line — best for commits only you have.
  3. In gg: m on one branch, m on the other, then pick Merge or Rebase. The first-marked branch is the one merged in or rebased.

How do I undo a merge or rebase?

  1. ctrl+p → Branch versions… — gg snapshotted the branch before the operation.
  2. Pick the version from before it, press r (reset branch) and confirm.

Plain git: git reset --hard ORIG_HEAD (only right after)

Recover after reset --hard

ctrl+right flips the bottom box from Staged to Reflog, where the commits git reset --hard HEAD~3 walked away from are still listed with sha, message and age. . → Reset to this entry confirms, makes you pick soft/mixed/hard, and puts the branch back. Git keeps reflog entries for 90 days, so this works long after the panic.

How do I recover commits lost after git reset --hard?

  1. Open gg, focus the bottom box of the left column and press ctrl+→ — it flips from Staged to Reflog.
  2. The reset is at the top; the commits it walked away from are right underneath. Put the cursor on the last good one.
  3. Press ., type reset, choose Reset to this entry.
  4. Confirm (the default is No), choose hard (the default is soft — only hard restores the files), then proceed past the warning that the commit is not on the current branch.
  5. The branch is back with all its commits. The reflog keeps entries for 90 days by default.

Plain git: git reflog, then git reset --hard <sha>

Tags & releases

. → Create tag here on the commit you're shipping: leave the message empty for a lightweight pointer, fill it in for a real annotated tag — the popup tells you which you're getting. The Tags tab lists the release history with the commit each points at and whether the remote has it, and gg tag create/push/checkout do the same from a script.

How do I create an annotated tag for a release?

  1. Focus the commit graph and put the cursor on the release commit.
  2. Press ., type tag, choose Create tag here, enter.
  3. Type the name, tab, write the message, enter. With a message you get an annotated tag (author, date, message); leave it empty for a lightweight one.

Plain git: git tag -a v1.0.0 -m "…"

How do I list, push or check out tags?

  1. Focus the Files box and press ctrl+→ for the Tags tab — every tag, newest first, with its commit.
  2. . on a tag: check it out, merge or rebase against it, or push it to the remote.
  3. From scripts: gg tag ls, gg tag create, gg tag push, gg tag checkout.

Plain git: git tag, git push origin <tag>

Blame in the terminal

ctrl+p → File blame on any path, without opening the file first: every line tagged with its commit, author and age, consecutive lines grouped so you read the file instead of a column of shas. Recorded on the Linux kernel's kernel/sched/core.c — and enter on a line opens that file's history at that commit, diff beside it.

How do I see who changed a line (git blame)?

  1. Press ctrl+p, type blame, choose File blame, type the path (e.g. kernel/sched/core.c) and enter — you don't need the file open first. b on a file in any file list opens it too.
  2. Every line shows the commit that last changed it, its author and age; consecutive lines from one commit are grouped.
  3. Move to a line and press enter: the file's history opens at that commit, with the diff beside it.
  4. esc brings you back to the same line of the blame.

Plain git: git blame <file>

Find anything in 1.46M commits

F fuzzy-finds across all 94,852 tracked files of the Linux kernel. The commit feed is paged — that's why the repo opened in a second — so / filters only what's loaded and ctrl+f keeps paging backwards through history until it finds a real match. \ opens a proper filter by path, author, message or date range.

How do I find a file quickly in a huge repository?

  1. Press F — the file finder lists every file in the working tree.
  2. Press / and type part of the name; the list narrows as you type. esc twice closes it (query, then window).

Plain git: git ls-files | grep <name>

How do I search commit messages, including history that isn't loaded yet?

  1. Focus the commit graph, press / and type — it filters the commits already loaded.
  2. No match? Press ctrl+f: it pages back through unloaded history until it finds the next real match.
  3. For path, author, message or date filters use \ (or . → filter) — see Linux-kernel scale.

Plain git: git log --grep=<text>

Detached HEAD — and the one command that fixes it

In gg detached HEAD is the first thing on screen: the title bar reads branch (detached) and the feed's label column says HEAD on every row. A commit made while detached forks onto a lane of its own that no branch points at. The fix is one line — gg branch create rescue-lane uses exactly where you are, gg switch re-attaches you, and the same commit now has a name.

What is detached HEAD and how do I fix it?

  1. Detached HEAD means you are on a commit, not a branch. gg shows (detached) in the title bar and labels commits HEAD instead of a branch name; commits made now sit on a lane of their own.
  2. Keep that work: run gg branch create rescue-lane — with no start point it branches from exactly where you are.
  3. Run gg switch rescue-lane. HEAD is attached again and the commits are safe.
  4. Don't press b in the Branches panel for this — it branches from the selected row, not from HEAD. And switching away first strands the detached commits.

Plain git: git switch -c rescue-lane

Let your coding agent drive git — gg mcp

claude mcp add --scope project gg -- gg mcp wires up gg's stdio MCP server. It deliberately exposes no git operations — the agent has the gg CLI for those — only what nothing else knows: bookmarks, the shelf, comparisons between any two versions, and gg_ui_state, what your terminal is showing right now. Recorded with a live claude -p call reading back a file shelved seconds earlier.

How do I connect gg to Claude Code as an MCP server?

  1. Run claude mcp add --scope project gg -- gg mcp. Project scope writes .mcp.json into the repo, so the whole team gets it.
  2. That's all: a stdio server, no keys, no daemon. Other MCP clients use the same gg mcp command.

What can an AI agent do through gg mcp?

  1. It serves what only gg knows: bookmarks, the shelf, tree and file comparison between any two versions, export, and cherry-picking a shelved commit back.
  2. It can also tell the agent what your gg screen shows right now — the focused panel, the commit under the cursor, marked files — so “explain this diff” works.
  3. It deliberately exposes no git operations; the agent uses the gg command line for those. Try: claude -p "what is on my gg shelf?".

Every file in one scroll

S stacks every file of a commit into one syntax-highlighted scroll, like a pull request's Files changed tab. f folds the unchanged lines, / searches the whole commit, J jumps to a file by name.

How do I see the diff of every file in a commit in one scroll?

  1. Open the commit: select it in the graph and press enter (or press # and paste a commit id to jump straight to it).
  2. Open any file's diff, then press S — every file in the commit becomes one continuous scroll.
  3. f folds away unchanged lines; _ folds every file to a header with its +/- counts — the whole commit on one screen.
  4. N jumps to the next file, n to the next change, across file boundaries.
  5. gg remembers the choice: the next diff opens stacked too. S again goes back to one file at a time.

Plain git: git show <commit>

How do I search across all files of a commit's diff?

  1. In the stacked diff (S), press /, type the text and enter — it searches the whole commit, not one file.
  2. ] walks from hit to hit, into the next file.
  3. J jumps to a file by name: type part of it, enter.

Preview a merge

Compare shows every difference between two tips — including the other branch's own work. Merge preview shows only what the merge will bring in, and stays live in the Previews tab.

How do I see what a merge will change before I merge?

  1. On the Branches panel press m on the branch, then m on the branch you'd merge into (e.g. main).
  2. Pick Merge preview. It measures the branch from where it left main — exactly what the merge would bring in, like a pull request diff.
  3. Choose show and save: the changed files are listed; enter opens a file, f shows only the changed lines.
  4. The preview is saved in the Previews tab (ctrl+→ on the top-left box). It stays live — when either branch moves, the row updates; enter reopens it.

Plain git: git diff main...feature

How do I compare two branches?

  1. Press m on one branch and m on the other, then pick Compare — the plain diff between the two tips.
  2. Note that Compare also shows the other branch's own new commits (in reverse); use Merge preview when you only want what a merge would change.

Plain git: git diff main..feature

Review notes on lines

Review a branch without a pull request: c anchors a note to a line or a range of lines, the file list counts the notes, and ctrl+p → View all notes lists every note in the repository.

How do I leave a code review comment on a line, without a pull request?

  1. Open the commit and the file's diff (enter, enter).
  2. Move the line cursor with j / k to the line and press c.
  3. Write a one-line summary, tab, the reasoning, then ctrl+s to save.
  4. To cover several lines: space starts a mark, move down, space again, then c — one note over the whole range.
  5. Back on the file list, the file shows ◆ and its note count. Notes are anchored to that commit and those lines.

How do I see all review notes in the repository?

  1. Press ctrl+p, type all notes, choose View all notes — grouped by commit and file, with author, location and time.
  2. enter on a note jumps straight to its line in its diff.

Recycle a worktree

Instead of making yet another worktree, hand an existing one over to a new branch. Leftover work in it is committed, shelved or discarded — your choice — first.

How do I reuse an existing worktree for another branch?

  1. On the Branches panel, select the branch that has no checkout yet.
  2. Press ., type recycle, choose Recycle a worktree — gg lists every checkout it could hand over.
  3. Pick the worktree. If it still has uncommitted work, gg asks: commit it (default), shelve it, discard it, or stop.
  4. Choose shelve to keep the work: it goes on the shelf, the worktree is cleaned and switched to the new branch — same directory.
  5. The old branch keeps all its commits. The shelved edit is in G, named after the worktree and branch; p restores it.

Plain git: commit or stash in the worktree, then git -C <worktree> switch <branch>

Find stale branches

alt+1…alt+5 toggle per-repo branch filters — by age, prefix, suffix or regex — defined in .gg.toml so the whole team shares them.

How do I find and clean up stale branches?

  1. Define a branch filter for the repo, e.g. “show only branches older than 90 days” — in Settings (, → branch filters) or in the repo's .gg.toml, so the team shares it.
  2. On the Branches panel press alt+1 to toggle the first filter; alt+2…alt+5 are the other slots. The same key turns it off.
  3. The branch you're on never hides (a dim ★ marks it), and branches checked out in a worktree are exempt.
  4. Select a stale branch and press d to delete it; for unmerged branches gg asks a second time. Branch versions can still restore it.

Plain git: git for-each-ref --sort=committerdate refs/heads/

How do I hide some branches, like agent/ branches, from the list?

  1. Add a filter that hides by prefix (e.g. agent/) — by age, prefix, suffix or regex — in Settings → branch filters or .gg.toml.
  2. Toggle it with its alt+<slot> key on the Branches panel.

Image diffs in the terminal

Where git says “Binary files differ”, gg draws the old and new image in the terminal — side by side, stacked, or one at a time.

How do I see what changed in an image (git says “Binary files differ”)?

  1. Open the changed image like any file: tab to Files (or open a commit) and press enter.
  2. gg draws both versions in the terminal, old on the left and new on the right, with their sizes.
  3. ctrl+w switches the layout: stacked (old above new), then one at a time — tab flips between old and new in the same spot.
  4. It works the same in a commit, in a file's history and in the stacked diff.

Plain git: git diff only prints “Binary files differ”

Pull blocked by local changes

When git pull says your local changes (or an untracked file) would be overwritten, gg names the files in the way and offers to shelve or discard them — then pulls.

git pull says “Your local changes would be overwritten by merge” — how do I fix it?

  1. In gg press p and confirm (the default answer is No — choose Yes).
  2. gg lists exactly which files are in the way — edited files and untracked ones — and asks what to do.
  3. Choose shelve (the default): the files go onto the shelf as one entry and gg runs the pull again — this time it goes through.
  4. Press G to see the shelved entry; p restores it whenever you're ready (gg asks before overwriting). Choose discard instead if the local change was throwaway.

Plain git: git stash -u && git pull && git stash pop

git pull says “untracked working tree files would be overwritten” — what do I do?

  1. The same flow handles untracked files: p, and gg offers to shelve them together with any edits (plain git stash skips untracked files).

Answer review remarks

Every review remark is a thread, like a pull request comment: R replies, x resolves it and folds it away, and your agent can read the answers back.

How do I reply to and resolve code review comments in the terminal?

  1. Open the reviewed commit (it shows ✎), open the review and a file — each remark sits boxed under its line.
  2. } jumps to the next remark.
  3. R replies in the thread; write it and ctrl+s.
  4. x resolves the thread — it folds to one line. o unfolds it, x again reopens it.
  5. Back on the commit, the review row counts resolved and open remarks. Your agent can read the replies with gg review show and answer in the same threads.

Run Claude Code in a worktree

Start Claude Code (or Codex, Junie, …) in a branch's worktree from inside gg. Its console docks over the graph, its row says when it needs you, and ctrl+\ lists every session.

How do I run Claude Code in a git worktree from gg?

  1. On the Branches panel, select a branch that has its own worktree.
  2. Press ., type agent, choose Start agent — gg lists the coding agents it found (Claude Code, Codex, …); pick one.
  3. Approve the exact command (first time), optionally name the session, and the agent starts docked in gg — working in that worktree, not yours.
  4. Type the task as usual.

How do I run several coding agents in parallel and know when one needs me?

  1. ctrl+] steps out of an agent's console; it keeps working, and its row under the branch shows what it's doing.
  2. When it waits for permission, the row and the status line say needs input — select it and enter to type into its console again.
  3. alt+a walks your agent sessions; ctrl+\ lists every agent and terminal gg runs — k kills a session, x removes it.

Delegate to a worker agent

/gg-delegate in an agent's console prepares a worktree, briefs a worker agent and starts it — then gets out of the way. The worker prints its task, does the work, and ends with its result in its own console.

How do I have one coding agent hand a task to another in its own worktree?

  1. Start an overseer agent (. → Start agent) on your branch. The worker command must be one you allowed and approved once.
  2. In its console type /gg-delegate followed by the task in plain words (which worktree or branch, what to do).
  3. The overseer claims the worktree, writes a brief, starts a worker there — a second session appears under that branch — and stops; it doesn't wait.
  4. Carry on with your work. The worker's row under that branch shows whether it is still working.

How do I see what a worker agent did?

  1. alt+a walks your agents: the worker's console shows the task it got and ends with its result — what changed and the commit. It stays open for follow-up questions.

Your agent's overview

Instead of reading an agent's whole diff cold, read its walk-through: stored on the commit, shown beside the real code, each link jumping to the exact lines.

How do I review what an AI agent changed?

  1. Ask the agent for a gg overview (the gg-overview skill), or save one with gg overview save. It is stored on the commit it explains — marked ≡ in the graph and as a row under the branch.
  2. Select it and press enter: the walk-through on the left, the real file at that commit on the right, with the first link's lines marked.
  3. ↓ / ↑ walk the links — the file follows, even into other files. The agent's remarks sit boxed under the lines they're about.
  4. tab gives the keyboard to the file; D flips it to the commit's diff of that file; S stacks every file the overview mentions in one scroll.
  5. The overview stays on the commit — reopen it from the branch, the graph or View all notes. The . menu exports it as one HTML file to send to someone without gg.

Switch worktrees in one key

alt+w walks every worktree of the repo — its branch, its files, its uncommitted changes — without cd or a new terminal.

How do I switch between git worktrees quickly?

  1. On the Branches panel press alt+w: the first press shows where you are.
  2. Press it again: gg shows the next worktree instantly — its branch and its files, including uncommitted changes. tab and enter look around as in any checkout.
  3. From anywhere, alt+w first closes what's open and shows your current worktree; keep pressing to go round. Past the last one it comes back to yours; the status line shows where you are (e.g. 3/3).
  4. Anything you start from there runs in that worktree.

Plain git: cd ../<worktree> in another terminal

Triage an AI review

An AI review leads with a count of issues, suggestions and nitpicks; each remark says its kind, severity and confidence. Mark each one agreed, disagreed or deferred.

How do I triage AI code review comments (agree, disagree, defer)?

  1. Open the review: it leads with a count of issues, suggestions and nitpicks, and who each is for.
  2. Open a file and } to the first remark — its header shows the kind, severity and audience, with the agent's confidence below.
  3. Agree? Press ., type mark, choose Mark… → agreed. The remark carries your verdict and your name.
  4. } to the next; mark it disagreed — or deferred for later.
  5. A mark is only a tag: it doesn't resolve the thread or send anything. A second agent double-checking the review writes the same tags, so verdicts sit side by side.

Fix “index.lock: File exists”

A git that was killed, crashed or lost power leaves .git/index.lock behind, and git refuses to stage, commit, switch, merge, rebase, stash or pull. gg spots the stranded lock when it opens, shows what it blocks, and removes it when you say so.

git says “Unable to create '.git/index.lock': File exists. Another git process seems to be running” — how do I fix it?

  1. Open gg in the repository. If a stranded lock is there, the status line shows a notice before you touch anything.
  2. Press !, then enter for the details: which lock (index.lock), how old it is, its full path, and what it blocks: staging, committing, switching branches, merging, rebasing, stashing and pulling.
  3. Check that no git is actually running. gg never decides a lock is stale on its own, because a git running right now holds one legitimately. Then choose Remove the lock file, and git works again.

Plain git: rm -f .git/index.lock, after checking that no git process is running

How do I remove stranded git lock files from a script?

  1. gg unlock lists stranded locks and exits with 1 while any is present; gg unlock --yes removes them.

Several repositories in one window

A workspace opens up to ten repositories together: every repository's branches in one list, and enter on another repository's row switches the whole screen to it, with its commits, files and diffs.

How do I work with multiple git repositories at once?

  1. Press ctrl+p, type work and press enter to open Workspaces….
  2. Press n, name the workspace and press enter. Then enter on it, and a to add repositories: the one you're in first, then any other by path (Path…, e.g. ../website), up to ten.
  3. Press esc, then o to open the workspace. The Branches panel lists each repository under its own heading, and every one stays watched.
  4. Press enter on another repository's row to switch to it: its commits, its files, its diffs. Stage and commit there as usual.

Plain git: a terminal (or cd) per repository

How do I open a gg workspace again?

  1. Start gg in any of its repositories: gg asks whether to open the workspace or just that repository; enter opens the workspace. gg --workspace <name> skips the question.
Features
Install

Latest release: v0.5.10. Requires a git binary on PATH (and Go 1.26 for the go install route).

# Homebrew (macOS / Linux)
brew install homeend/tap/gg

# or install the latest from GitHub (binary lands in $GOBIN / $GOPATH/bin as `gg`)
go install github.com/homeend/gigagit/cmd/gg@latest

Run gg with no arguments to open the interactive UI.

FAQ

What is gg?

gg (GigaGit) is a fast terminal git client for very large monorepos — GitKraken's one-key smart operations with lazygit's keyboard-driven TUI. One binary gives you both a rich interactive TUI and a fully scriptable CLI.

How is it different from lazygit or GitKraken?

It aims at the sweet spot between them: lazygit's keyboard-first terminal workflow, combined with GitKraken-style smart operations — multi-step flows like pull-with-divergence, switch-with-local-changes or worktree create-and-cd become single keystrokes that only ask you a focused question when there's a real decision to make. And it's built to stay fast on repos where ordinary git tooling gets slow.

Where can I see it in action?

The demos above are short videos from the code-drill YouTube channel — most show a single workflow in about a minute, from browsing the Linux kernel's history to letting an AI agent resolve a merge conflict, and one runs through fifteen features in a single take.

Every video also has a written, step-by-step recipe underneath — the exact keys for each task it shows — and the How do I…? index at the top of that section lists every question they answer.

Does it replace git?

No. gg shells out to your system git binary for every operation, so it works with your existing git version, config, hooks and credentials.

What platforms are supported?

It's cross-platform — Linux, macOS and Windows.

How do I install it?

brew install homeend/tap/gg (macOS/Linux), or go install github.com/homeend/gigagit/cmd/gg@latest with Go installed. See the README for building from source.

Is it stable?

Actively developed and ready for daily use: the worktree-aware engine, one-key smart operations (pull / switch / merge / rebase / commit / stash / undo), interactive rebase, conflict resolution, the keyboard TUI and the scriptable CLI are all in place, along with agent consoles, review notes, AI reviews with overviews, sending reviews to GitHub pull requests and the browser UI. The latest release is v0.5.9; no 1.0 tag has been cut yet.

Can AI agents use it?

Yes, three ways. gg can run agents itself — Claude Code, Codex, Junie and others in live consoles inside the TUI or the browser page — and an agent in one of those consoles can hand a task to a worker agent in another worktree (/gg-delegate). Agents never send anything to GitHub: they write local notes and reviews, and you send them. gg mcp serves agents what only gg knows (the live TUI state, bookmarks, shelves, comparisons, review notes), read-only, with mutating tools behind your MCP client's consent prompt. And the CLI is fully scriptable, so it works from any agent or script.

Is it free?

gg is source-available under the PolyForm Noncommercial License 1.0.0: free for personal, hobby, research, educational and non-profit use; commercial use needs a license from the author (see COMMERCIAL.md). Releases through v0.3.0 were published under MIT and remain so.