Git worktree manager. Simplifies creating, switching between, and cleaning up worktrees.
/path/to/wt --installThis adds a shell function to your config file (~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish). Reload your shell:
source ~/.bashrc # or ~/.zshrc or: source ~/.config/fish/config.fishwt -c <branch> [base] # Create worktree (base defaults to current branch)
wt --rm <branch> # Remove worktree
wt --nuke # Remove current worktree and return to main repo
wt --clean # Interactive cleanup of all worktrees
wt --ls # List worktrees--skip-bootstrap- Skip running the bootstrap script
When creating a worktree, wt looks for scripts/wt_bootstrap.sh in your repository. If present, it runs automatically after worktree creation.
The script receives two arguments:
- Path to the main repository
- Path to the new worktree
#!/bin/bash
# scripts/wt_bootstrap.sh
MAIN_REPO="$1"
WORKTREE="$2"
cd "$WORKTREE"
npm ciSkip bootstrap with:
wt -c my-branch --skip-bootstrap