GitGudGUI
A git commit graph for VS Code.

Features
Graph
- Opens in an editor tab.
- The trunk branch is always in the first lane. Every other branch keeps its lane and color between refreshes.
- Labels for branches, tags, HEAD and stashes.
- An "Uncommitted changes" row at the top.
- A branch that forked far back shows a short "based on develop" marker instead of a long line.
- Search by message, author, hash or label.
- Large histories scroll smoothly.
- Light, dark and high-contrast themes.

Commit details
- Message, author, parents, changed files and every branch that contains the commit.
- Click a file to open its diff in VS Code.
- Cmd/Ctrl-click a second commit to compare the two.

Branch panel
- Ahead and behind counts against the trunk.
- Groups: Local, Only on origin, Stale, Hidden, Worktrees and Stashes.
- Merged branches and branches deleted on the remote are hidden by default. You can hide more by name, for example
dependabot/*.
- Click a branch to highlight its commits, or show only that branch.

Panels
- Drag a panel's edge to resize it. Double-click the edge to reset it.
- Drag the grip in a panel's header to move it, or click the grip and pick a side. Details can go on the left, on the right or under the selected commit.
- Sizes and positions are remembered.
File history
- Show only the commits that touch a file, including commits from before it was renamed.
Ticket and pull request links
- Ticket keys (such as
APP-123) and pull request numbers (such as (#123)) in commit messages become links.
Git actions
- Check out a branch or commit, create a branch or tag, cherry-pick, revert, fetch, delete a branch, and apply, pop or drop a stash.
- Merge a branch or commit into the current branch, or rebase the current branch onto it.
- Fast-forward a branch that is behind its upstream, without checking it out.
- Pull: GitGudGUI fetches first, shows what came in, then lets you fast-forward, merge or rebase.
- Push, and force push.
- Delete a branch on a remote.
- Push a tag, delete a tag, and delete a tag on a remote.
- Reset the current branch to a commit: soft keeps the changes staged, mixed keeps them in your files, and hard discards them along with your uncommitted changes.
- Rename a branch.
- Set which remote branch a local branch tracks (its upstream), or stop tracking one. Pull and Push use the upstream.
- Create a branch and check it out in one step.
- Create an annotated tag with a message.
- Stash your changes from the Uncommitted changes row, with an optional message. Untracked files are included only if you tick the box.
- Create a branch from a stash. The new branch starts at the commit the stash was made on and is checked out. The stash is applied there and dropped if it applies cleanly.
- Copy a commit's hash or subject from its right-click menu.
- Each action shows the git command before it runs. Nothing runs until you click Run.
- Pushes and deletions on a remote show the remote's URL.
- Pull, Push and Fetch are buttons in the toolbar.
- Actions that talk to a remote can be stopped while they run.
- Force push never uses plain
--force. If someone pushed to the branch since your last fetch, git refuses. GitGudGUI never force pushes or deletes the trunk or the remote's default branch.
- Deleting a branch or tag on a remote, and rebasing commits that are already on a remote, ask you to type the name to confirm.
git branch -D, git stash drop, force push, git reset --hard, and deleting a remote branch whose commits are on no other branch are off by default. Turn them on with gitgudgui.allowDestructiveActions. Each one then asks you to type the name to confirm.
Conflicts
When a merge, rebase, cherry-pick or revert stops on conflicts, a banner shows above the graph. Resolve the files in Source Control (the banner has a button for it), then click Continue. Skip leaves the current commit out (rebase, cherry-pick and revert). Abort puts the branch back as it was. Each button shows its git command first, like every other action.
If a stash apply or pop conflicts, the banner offers Source Control only. git keeps the stash.
Undo
After a merge, rebase, pull, cherry-pick or revert, or a fast-forward of the checked-out branch, the result message has an Undo button. It moves the branch back to where it was with git reset --keep, which keeps your uncommitted changes. Undo is only offered until the branch moves again.

Install
In VS Code, run Extensions: Install from VSIX… and pick gitgudgui-0.2.0.vsix. Requires VS Code 1.95 or newer.
Usage
Run GitGudGUI: Open Graph from the command palette.
| Command |
What it does |
GitGudGUI: Open Graph |
Opens the graph for the current repository. |
GitGudGUI: Show File History |
Shows only the commits that touch a file. |
Git actions are in the details panel's Actions menu and in the right-click menu on commits, branches, tags, stashes and the Uncommitted changes row. Fetch, Pull and Push are also in the toolbar.
| Key |
In the graph |
↑ ↓ or j k |
Move between commits |
Enter |
Open the details of the selected commit |
Esc |
Close details, clear the search or clear a focused branch |
/ |
Focus the search box |
b |
Create a branch at the selected commit |
t |
Create a tag |
c |
Cherry-pick |
r |
Revert |
x |
Check out the branch, or the commit when it has no branch |
m |
Merge the selected branch or commit into the current branch |
Shift+R |
Rebase the current branch onto the selected commit |
s |
Stash your changes, on the Uncommitted changes row |
| Cmd/Ctrl-click |
Compare a second commit with the selected one |
Settings
| Setting |
Default |
What it does |
gitgudgui.trunk |
"" |
Trunk branch drawn in the first lane. Empty uses origin/HEAD, else develop, main or master. |
gitgudgui.maxCommits |
200000 |
Most commits to load. |
gitgudgui.laneCap |
12 |
Lanes drawn before the rest collapse into a "+N more" marker. |
gitgudgui.stubAfterRows |
10 |
Show the "based on" marker when a branch line would be longer than this many rows. 0 turns it off. |
gitgudgui.hiddenBranchPatterns |
["dependabot/*"] |
Branch name patterns hidden in every repository. |
gitgudgui.ticketPattern |
[A-Z][A-Z0-9]+-\d+ |
Regular expression for ticket keys. Empty turns ticket links off. |
gitgudgui.ticketUrl |
"" |
Ticket link, with {key} where the key goes. |
gitgudgui.allowDestructiveActions |
false |
Allow git branch -D, git stash drop, force push, git reset --hard, and deleting a remote branch whose commits are on no other branch. Each asks you to type the name to confirm. |
License
MIT. See LICENSE.
| |