| name | gwt |
| description | Manage git worktrees using gwt for branch-based workflow. Use when switching branches, creating worktrees, listing worktrees, or cleaning up after merging PRs. |
GWT Worktree Management Skill
You have access to gwt, a Git worktree management tool that simplifies working with multiple branches simultaneously. Use gwt instead of raw git worktree commands for a streamlined workflow.
Available Commands
Switch to a Branch Worktree
gwt sw <branch>
gwt sw -b <branch>
gwt sw -m
gwt sw <branch> --remote <remote>
List Worktrees
gwt ls
gwt ls --full
Remove Worktrees
gwt rm <branch>
gwt rm <branch> -y
gwt rm <branch> -b
gwt rm <branch> -B
gwt rm --this
Navigation
gwt home
gwt current
Workflow Patterns
Starting Work on a Feature
- Use
gwt sw -b feature/name to create a new branch and worktree
- Work on the feature in the isolated worktree
- The original repository remains on its branch
Switching Between Tasks
- Use
gwt sw other-branch to switch to another worktree
- No need to stash changes - each worktree is independent
- Use
gwt ls to see all available worktrees
Cleaning Up After PR Merge
- Use
gwt home to return to main repository
- Use
gwt rm feature/name -b to remove worktree and delete merged branch
- Or use
gwt rm --this -b if still in the feature worktree
Checking Current Location
Use gwt current to see which branch and worktree you're in.
Key Benefits
- Automatic directory switching: gwt changes your shell's working directory automatically
- Centralized storage: Worktrees are stored in
~/.gwt_store, keeping repos clean
- Just-in-time creation: Worktrees are created automatically when switching to new branches
- Smart remote lookup: Automatically finds and tracks remote branches
When to Use gwt
- Switching between branches for code review or testing
- Working on multiple features in parallel
- Isolating experimental changes without affecting main work
- Quick context switching without stashing changes