Automates git worktree setup: creates the worktree, copies essential files, and runs your setup commands. Pairs nicely with lazygit.
curl -fsSL https://raw.githubusercontent.com/crobbo/wt-feature/master/install.sh | bash~/projects/
├── your-repo/ # Main repository (auto-detected)
│
└── your-repo-worktrees/ # Worktrees live beside the main repo
├── feature-login/
├── bugfix-issue-123/
└── hotfix-urgent/
wt-feature <name> [base-branch]- name - Branch name or feature name
- base-branch - Base branch (optional, auto-detected based on branch type)
wt-remove <name>Removes the worktree and cleans up. If you're inside the worktree, it moves you to the main repo first.
wt-updateDownloads the latest version of wt-feature. Your configuration is preserved.
| Branch Type | Default Base |
|---|---|
hotfix/* |
main |
feature/* |
develop |
bugfix/* |
develop |
# New feature branch from develop
wt-feature my-feature
# New bugfix from develop
wt-feature bugfix/login-issue
# New hotfix from main
wt-feature hotfix/urgent
# Branch off a specific local branch
wt-feature my-feature some-local-branch
# Use existing branch
wt-feature feature/existing-branch
# Remove a worktree
wt-remove feature-my-feature
wt-remove feature/my-feature # also works- Fetches latest from remote (if base is
origin/*) - Creates worktree beside your main repo (e.g.,
~/projects/myapp-worktrees/feature-name) - Creates new branch or checks out existing branch
- Copies configured files to the new worktree
- Runs setup commands (e.g.,
bundle install,yarn install) - Changes into the new worktree directory
The installer prompts for configuration, which is saved to ~/.config/wt-feature/config.
You can edit this file directly:
# Where to create worktrees
# (default: if repo is ~/projects/myapp, worktrees go in ~/projects/myapp-worktrees)
WT_WORKTREES_DIR=""
# Files to copy from main repo (space-separated)
WT_FILES_TO_COPY="config/master.key .env"
# Commands to run after creating worktree
WT_SETUP_COMMANDS="bundle install && yarn install"curl -fsSL https://raw.githubusercontent.com/crobbo/wt-feature/master/uninstall.sh | bashOr manually:
rm ~/.local/bin/wt-feature.sh
rm -rf ~/.config/wt-feature
# Remove the source line from ~/.zshrc or ~/.bashrcMIT