A terminal UI for managing git worktrees, launched via gtf.
brew tap ckreymborg/tap
brew install gtfgo install github.com/cKreymborg/git-treeflow/cmd/gtf@latestOr clone and build:
git clone https://github.com/cKreymborg/git-treeflow.git
cd git-treeflow
go install ./cmd/gtfThe gtf command needs a shell wrapper to cd into worktrees. Add one of these to your shell config:
zsh (~/.zshrc):
eval "$(gtf --init zsh)"bash (~/.bashrc):
eval "$(gtf --init bash)"fish (~/.config/fish/config.fish):
gtf --init fish | sourceRestart your shell or source the config file.
gtf # Launch the TUI
gtf <name> # Jump directly to a worktree (fuzzy match)
gtf --init zsh # Print shell init script
gtf --help # Show help
gtf --version # Show version| Key | Action |
|---|---|
j / k |
Move down / up |
g / G |
Jump to top / bottom |
Enter |
Switch to selected worktree |
c |
Create new worktree |
d |
Delete worktree |
p |
Prune stale worktrees |
s |
Settings |
? |
Help |
q / Esc |
Quit / back |
Press c to start the create flow:
- Enter a worktree name
- Choose branch mode: new branch, local branch, or remote branch
- Select or enter the branch name (with fuzzy search for existing branches)
- Confirm
New worktrees are created at ../{repoName}.worktree/{worktreeName} by default. Files matching .env* are automatically copied from the main repo.
Config uses TOML with two layers:
- Global:
~/.config/git-treeflow/config.toml - Per-repo:
.git-treeflow.tomlin the repo root
Per-repo settings override global settings. Edit from the TUI via s, or directly:
# Where to create worktrees (relative to repo root)
# Variables: {repoName}, {worktreeName}, {branchName}, {date}
worktree_path = "../{repoName}.worktree/{worktreeName}"
# Files/globs to copy into new worktrees
copy_files = [".env*"]
# Commands to run after creating a worktree
post_create_hooks = [
"npm install",
]MIT




