Minimal git worktree manager with an interactive picker.
cargo install --path .cargo build- Rust toolchain (see
rust-toolchain.toml) - Git 2.5+ (for
git worktree) - Bash or Zsh for
autocd
gww checkout|co [branch]- Checkout a branch into a worktree (fuzzy select when omitted).gww <branch>- Shortcut forgww checkout <branch>.gww checkout -b <branch>- Create a branch if it does not exist.gww list|ls- Show worktrees (rawgit worktree listoutput).gww remove|rm [branch]- Remove a worktree (fuzzy select when omitted).gww autocd- Emit a shell wrapper for auto-cd behavior.
Worktree root is set by WORKTREE_ROOT, defaulting to $HOME/devel/worktrees.
Worktrees are stored under $WORKTREE_ROOT/<repo>/<branch>.
WORKTREE_ROOT- Base directory for worktrees.GWW_NO_COLOUR- Disable ANSI colors when set.GWW_SUBMODULE_ON_CHECKOUT- Initialize submodules recursively when set.
Add to your shell config:
source <(gww autocd)When the wrapper is sourced, gww checkout prints GWW_CD:<path> on success
and the wrapper cds into that path.
This is an experiment in vibe coding, although it seems useful in its own right. I previously used tree-me and found it useful, so most of the inspiration for gww comes from tree-me's behaviour, and the things I thought it could do a bit better for my use (mostly the branch chooser with fuzzy search).