A fast, project-aware Git worktree manager that simplifies working with multiple branches.
This is a personal utility project. While public for ease of access, I'm not accepting external contributions at this time.
- π Quick Navigation - Switch between worktrees instantly with
wt go
orwt 0
,wt 1
- π§ Smart Commands -
wt new feature
works regardless of branch state (new/existing/has worktree) - π Fuzzy Matching -
wt go mai
automatically switches tomain
, with smart suggestions - π Universal Help - All commands support
--help
/-h
with detailed documentation - π Project-Specific Commands - Define custom navigation shortcuts per project
- π Environment Sync - Copy
.env
files between worktrees - π οΈ Self-Installing - Single binary that sets itself up
- π― Smart Detection - Automatically loads commands based on current project
- β¨οΈ Shell Completion - Intelligent tab completion for commands, branches, and flags
curl -fsSL https://raw.githubusercontent.com/tobiase/worktree-utils/main/get.sh | sh
Download the latest releases from the GitHub releases page.
git clone https://github.com/tobiase/worktree-utils.git
cd worktree-utils
make build
./wt-bin setup
# List all worktrees
wt list # or: wt ls
# Smart worktree creation (handles any branch state)
wt new feature-branch # Creates branch + worktree OR switches if exists
wt new feature --base main # Create from specific base branch
# Quick navigation with fuzzy matching
wt go 1 # Switch by index
wt go feature-branch # Switch by exact name
wt go feat # Fuzzy match to 'feature-branch'
wt go mai # Auto-switches to 'main'
wt 0 # Direct shortcut to first worktree
wt 1 # Direct shortcut to second worktree
# Smart removal with suggestions
wt rm feature-branch # Remove by exact name
wt rm feat # Fuzzy match for removal
# Get help for any command
wt go --help # Detailed help for 'go' command
wt new -h # Short help flag also works
wt
uses "Do What I Mean" design - commands understand your intent and provide helpful guidance:
# Fuzzy matching with auto-resolution
$ wt go mai
# β Automatically switches to 'main' (unambiguous match)
# Smart suggestions for ambiguous input
$ wt go te
# β Shows interactive picker: [test-branch, test-feature, temp-fix]
# Helpful error messages
$ wt go xyz
# β "branch 'xyz' not found. Did you mean:
# 1. main
# 2. fix-xyz-bug
# 3. feature-xyz"
# Smart worktree creation
$ wt new existing-branch
# β "Switched to existing worktree 'existing-branch'" (no error!)
$ wt new new-branch
# β Creates branch + worktree + switches (handles everything)
# Copy .env files to another worktree
wt env-copy feature-branch
wt env-copy feature-branch --recursive
# Initialize project configuration
wt project init myproject
Create project-specific navigation commands that only appear when you're in that project:
# ~/.config/wt/projects/myproject.yaml
name: myproject
match:
paths:
- /Users/you/projects/myproject
- /Users/you/projects/myproject-worktrees/*
commands:
dash:
description: "Go to dashboard"
target: "apps/dashboard"
api:
description: "Go to API"
target: "services/api"
Now wt dash
and wt api
are available only in the myproject repository.
wt provides intelligent shell completion for commands, branches, and flags to enhance your workflow.
Completion is automatically installed when you run the setup command:
wt setup
For existing installations or custom setups:
# Bash users
wt completion bash >> ~/.bashrc
source ~/.bashrc
# Zsh users
wt completion zsh >> ~/.zshrc
source ~/.zshrc
# Or use with eval for temporary testing
eval "$(wt completion bash)"
eval "$(wt completion zsh)"
- Command completion: Tab-complete all wt commands and aliases (
list
,ls
,go
,switch
, etc.) - Branch completion: Intelligent branch name suggestions for relevant commands
- Flag completion: Complete command flags with descriptions (e.g.,
--base
,--recursive
) - Project commands: Auto-complete project-specific commands when available
- Context-aware: Different completions based on command position and context
Control completion installation during setup:
# Install with auto-detected shell completion (default)
wt setup
# Install with specific shell completion
wt setup --completion bash
wt setup --completion zsh
# Install without completion
wt setup --no-completion
Configuration files are stored in ~/.config/wt/
:
~/.config/wt/
βββ init.sh # Shell integration
βββ completion.bash # Bash completion script
βββ completion.zsh # Zsh completion script
βββ projects/ # Project-specific configs
βββ project1.yaml
βββ project2.yaml
- Git Commands Reference - Detailed documentation of the underlying git commands
wt setup --uninstall
Then remove the initialization line from your shell config (.bashrc
, .zshrc
, etc.).
MIT License - see LICENSE file for details.