A blazing fast TUI for managing Git worktrees with zero friction
Ever find yourself juggling multiple feature branches, hotfixes, and experiments? Constantly stashing, switching branches, and losing context?
gt makes Git worktrees as easy as breathing.
Instantly manage all your Git worktrees with:
- Interactive TUI - See all worktrees at a glance
- Instant creation -
gt feature-xcreates and switches in one command - Smart organization - Keeps worktrees in
.worktrees/(auto-added to.git/info/exclude) - Zero config - Single binary, works out of the box
brew tap melonamin/formulae
brew install gtDownload the latest release from GitHub Releases:
curl -L https://github.com/melonamin/gt/releases/latest/download/gt-macos-universal.zip -o gt.zip
unzip gt.zip
chmod +x gt-macos-universal
sudo mv gt-macos-universal /usr/local/bin/gtcurl -L https://github.com/melonamin/gt/releases/latest/download/gt-linux-amd64.tar.gz | tar xz
chmod +x gt-linux-amd64
sudo mv gt-linux-amd64 /usr/local/bin/gtcurl -L https://github.com/melonamin/gt/releases/latest/download/gt-linux-arm64.tar.gz | tar xz
chmod +x gt-linux-arm64
sudo mv gt-linux-arm64 /usr/local/bin/gtgo install github.com/melonamin/gt@latestgit clone https://github.com/melonamin/gt.git
cd gt
go build -o ~/.local/bin/gtYou're working on a feature. Urgent bug comes in. You stash everything, switch branches, fix the bug, switch back, pop stash, resolve conflicts... 😤
Or worse: you have repo, repo-backup, repo-new, repo-actually-working scattered across your filesystem.
Each branch gets its own working directory. Switch instantly, no stashing:
$ gt
→ main ✓ Initial commit (2 hours ago)
feature-auth ● Add OAuth implementation (3 days ago)
fix-memory-leak ✓ Fix connection pooling (1 week ago)
[n]ew [d]elete [enter] switch [/] search [q]uit# In any git repository
gt # Open interactive worktree manager
gt feature-xyz # Create worktree 'feature-xyz' from current branch and switch
gt fix-bug main # Create worktree 'fix-bug' from 'main' branch and switchThat's it. No configuration needed.
gt my-featureCreates a new worktree from your current branch and switches to it immediately. Your original working directory stays untouched.
gtOpens a beautiful TUI showing all your worktrees with:
- Branch names and current status
- Last commit message and time
- Dirty state indicators (●)
- Current worktree highlighting
Press / in the TUI to fuzzy search through:
- Branch names
- Commit messages
- Worktree paths
Worktrees are stored in .worktrees/ within your repo:
my-project/
├── .git/
├── .worktrees/ # All worktrees here (auto-added to .git/info/exclude)
│ ├── feature-auth/
│ ├── fix-bug/
│ └── experiment/
└── ... your files
●Current worktree (where you are now)●Dirty (uncommitted changes)✓Clean- Time-aware display (2 hours ago, 3 days ago, etc.)
gt # Open interactive worktree manager
gt <name> # Create worktree from current branch and switch
gt <name> <branch> # Create worktree from specified branch and switch
gt -h, --help # Show help| Key | Action |
|---|---|
↑/↓ or j/k |
Navigate list |
Enter |
Switch to selected worktree |
n |
Create new worktree |
d |
Delete selected worktree |
/ |
Search/filter worktrees |
r |
Refresh list |
q or Ctrl+C |
Quit |
# Working on a feature, need to fix a bug
gt hotfix-memory-leak main # Creates worktree from main, switches there
# After fixing, go back
gt # Open TUI, select your feature, press Enter
# Start a new feature
gt new-oauth-flow # Creates from current branch
# Experiment without affecting anything
gt experiment-redis-cache developConfiguration file: ~/.config/gt/config.json
{
"worktree_dir": ".worktrees", // Where to store worktrees (relative or absolute)
"shell": "fish" // Override shell (default: $SHELL)
}The shell used when switching worktrees:
- Config file
shellsetting (if set) $SHELLenvironment variable- Fallback to
/bin/bash
Git worktrees let you have multiple working directories for the same repository. Instead of stashing/switching branches, you just switch directories. Each worktree has:
- Its own working directory
- Its own index (staging area)
- Its own HEAD (current branch)
- Shared repository data (.git)
gt makes worktrees frictionless by:
- Organizing them in one place
- Providing instant creation/switching
- Showing status at a glance
- Auto-managing
.git/info/exclude
| Feature | git worktree |
git stash |
gt |
|---|---|---|---|
| Switch Speed | Manual cd |
Slow (stash/pop) | Instant |
| Context Preservation | ✅ Full | ❌ Lost | ✅ Full |
| Discoverability | git worktree list |
git stash list |
Visual TUI |
| Creation | Multi-step | N/A | One command |
| Organization | DIY | N/A | Automatic |
| Learning Curve | Medium | Low | Zero |
Q: How is this different from just using git worktree?
A: gt is to git worktree what tig is to git log. It makes the powerful feature actually pleasant to use.
Q: Where are my worktrees stored?
A: By default in .worktrees/ within your repo. This is configurable and automatically added to .git/info/exclude.
Q: Can I use my existing worktrees?
A: Yes! gt shows all worktrees, regardless of where they were created.
Q: What happens to the worktree when I delete a branch?
A: The worktree remains but becomes detached. You can delete it with gt (press d in the TUI).
Q: Does this work with bare repositories? A: Yes, it works with any Git repository structure.
Worktrees are Git's best-kept secret. They solve the context-switching problem elegantly, but the CLI is clunky. gt makes them feel native.
No more:
- Lost stashes
- Conflicted merges after stash pop
- Uncommitted changes blocking branch switches
- Mental overhead of context switching
Just instant, clean switches between parallel workstreams.
The entire tool is a single Go file using the excellent Bubble Tea TUI framework. PRs welcome!
MIT - Do whatever you want with it.
