Git worktree manager powered by fzf.
Quickly list, switch to, create, or remove git worktrees with fuzzy search.
brew install RodrigoEspinosa/tap/wtgit clone https://github.com/RodrigoEspinosa/wt.git
cd wt
make installThis installs wt to /usr/local/bin by default. Override with PREFIX:
make install PREFIX=$HOME/.localbrew uninstall wt # Homebrew
make uninstall # from sourcegit2.5 or newer (for worktree support)- fzf
- Install
wt(see above). - Add shell integration to your rc file:
# zsh
eval "$(wt init zsh)"
# bash
eval "$(wt init bash)"
# fish
wt init fish | source- Run
wtinside any git repository.
wt # Interactive fuzzy picker
wt my-feature # Switch to branch worktree (creates if needed)
wt -d my-feature # Remove a worktree
wt -l # List all worktrees| Command | Description |
|---|---|
wt |
Launch fzf to fuzzy-pick a worktree |
wt <branch> |
Switch to the worktree for <branch>, creating it if it doesn't exist |
wt -d <branch> |
Remove the worktree (and local branch) for <branch> |
wt -l |
List all worktrees with their paths |
wt init <shell> |
Print shell integration for bash, zsh, or fish |
wt -h |
Show help |
wt -v |
Show version |
wt prints the selected worktree path to stdout. A subprocess can't change the parent shell's working directory, so wt init <shell> outputs a thin wrapper function that captures the path and cds into it. It also provides tab completions for branches, worktrees, and options.
| Key | Action |
|---|---|
Enter |
Select worktree (prints path) |
Ctrl-D |
Delete the highlighted worktree |
The preview pane on the right shows the last 10 commits for the highlighted worktree.
| Variable | Description | Default |
|---|---|---|
WT_BASE_DIR |
Parent directory for new worktrees | Sibling of the repo root |
When WT_BASE_DIR is not set, new worktrees are created as siblings of the repository root. For example, if your repo is at ~/src/myproject, worktrees are created under ~/src/.
A man page is included at doc/wt.1. To install it:
# With make
make install-man
# Or manually
cp doc/wt.1 /usr/local/share/man/man1/After installing, view it with man wt.
