Switch between git worktrees with speed. ⚡
- Fish completions work dinamically.
- The
listsubcommand is nownames, which lists out only the worktree basenames. - Completions work with spaces & special characters.
- Doesn't create a new shell instance when changing directory.
- Running
wt, instead ofwt -, goes to the main worktree (similar to howcditself works). - Checks for updates automatically once per day on the first invocation.
Download the script from the Release section.
Make the script executable.
$ chmod +x wtCopy the executable to any directory in your $PATH
$ sudo cp wt /usr/local/binFor Bash
sudo cp wt_completion /etc/bash_completion.dAdd this to the end of your ~/.bashrc:
eval "$(command wt init bash)"For ZSH
Note: completion file for zsh has
_prefix
Find paths where you can store your completion
print -rl -- $fpathCopy completion script to one of that location and restart the shell.
sudo cp _wt_completion <one-of-$fpath>
exec zshAdd this to the end of your ~/.zshrc:
eval "$(command wt init zsh)"For Fish
cp wt.fish ~/.config/fish/completionsAdd this to the end of your ~/.config/fish/config.fish:
command wt init fish | sourceTab autocompletion works for switching between your worktrees.
wt <TAB> <TAB>
# OR
wt <completion-characters> <TAB>Switch between worktrees. You can do a text search to change to the worktree directory.
$ wt <worktree-name/search-term>Go to root worktree directory
$ wtList out all the worktree names.
$ wt namesShow help message
$ wt helpUpdate to the latest release
$ wt updateShow the CLI version
$ wt version