Switch between git worktrees with speed. ⚡
- Fish completions work dinamically.
- The
list
subcommand 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 howcd
itself 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 wt
Copy the executable to any directory in your $PATH
$ sudo cp wt /usr/local/bin
For Bash
sudo cp wt_completion /etc/bash_completion.d
Add 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 -- $fpath
Copy completion script to one of that location and restart the shell.
sudo cp _wt_completion <one-of-$fpath>
exec zsh
Add this to the end of your ~/.zshrc
:
eval "$(command wt init zsh)"
For Fish
cp wt.fish ~/.config/fish/completions
Add this to the end of your ~/.config/fish/config.fish
:
command wt init fish | source
Tab 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
$ wt
List out all the worktree names.
$ wt names
Show help message
$ wt help
Update to the latest release
$ wt update
Show the CLI version
$ wt version