An opinionated git worktree manager
wt manages git worktrees using branch names instead of paths. Create worktrees,
run commands in isolated environments, and clean up safely.
wt is a CLI for git worktree management. Use branch names to create worktrees,
execute commands in them, and remove them when done.
Built for multi-branch workflows and AI-assisted development.
- Multi-branch workflows: Run commands in multiple worktrees from your main terminal
- Safe cleanup: Won't delete worktrees with uncommitted changes
- Automatic setup: New branches copy config files and run setup commands
- Multi-agent support: AI agents work in isolated environments while you stay in your main repo
See Multi-Agent Workflows for details.
Recommended - Install via Homebrew (handles PATH + completions):
brew tap trungung/wt
brew install wtHomebrew installs completion files automatically, but you still need eval "$(wt shell-setup)" to enable the wt cd wrapper.
Alternative - Install via Go:
go install github.com/trungung/wt/cmd/wt@latestFor binary downloads (macOS/Linux), see GitHub Releases.
If installing via Go or binary, add wt to your PATH (see quick PATH snippet in the Quickstart) and follow Shell Setup to enable completions and wt cd.
Run this in your main repository to create the local configuration file .wt.config.json:
wt initCreate a worktree for a new branch, execute commands inside it, and remove it when done:
| Command | Action |
|---|---|
wt feature/payment |
Create worktree at ./repo.wt/feature-payment |
(cd "$(wt feature/payment)" && npm test) |
Run command in the worktree directory |
wt prune |
Automatically remove merged worktrees |
Set up seamless navigation to worktrees:
# One-time setup
eval "$(wt shell-setup)"
# Now navigate easily
wt cd feature/new-auth # Creates worktree if needed and changes directoryThe wt cd command creates the worktree (if needed) and changes your shell's working directory to it. Supported shells: zsh, bash, fish.
For comprehensive setup and examples, see the Quickstart Guide.
- Quickstart Guide – Installation, setup, and examples
- Multi-Agent Workflows – Parallel development and AI agent workflows
- API Reference – Detailed command documentation
- Configuration Reference – All configuration options explained
Contributions are welcome! Please see the developer documentation for guidelines.
wt is released under the MIT License.