A CLI tool for quickly creating git worktrees with sensible defaults.
cargo install --path .Run wtc from within any git repository:
wtcThe tool will:
- Prompt for a branch name - Enter the name for your new branch (e.g.,
feature/my-feature) - Handle uncommitted changes - If you have uncommitted changes, choose whether to transfer them to the new worktree
- Create the worktree - Automatically creates it at
~/worktrees/{repo-name}/{branch-name} - Copy environment files - All
.env*files are copied to the new worktree
$ wtc
Branch name: feature/auth
You have uncommitted changes. Transfer them to the new worktree? [Y/n] y
Stashing changes...
Creating worktree at /Users/you/worktrees/my-project/feature-auth...
Copied .env
Copied .env.local
Applying stashed changes to new worktree...
Worktree created successfully!
Path: /Users/you/worktrees/my-project/feature-auth
To switch to the new worktree, run:
cd /Users/you/worktrees/my-project/feature-auth
- Branch name validation - Prevents empty names and spaces
- Automatic path generation - Converts
feature/footofeature-foofor the folder name - Change transfer - Safely moves uncommitted work using git stash
- Environment file copying - Keeps your local configuration in the new worktree
- Git
- Rust (for building)