Create your first worktree
Navigate to any git repository and create a worktree:1
Interactive mode
Run You’ll be guided through:
gwt without arguments for an interactive prompt:- Name — Enter name for both worktree and branch (press ESC to set separately)
- Stash/Switch — Handle uncommitted changes and switch to main
- Pull — Fetch latest changes from remote
2
Quick mode
Pass a name directly to skip prompts:This creates:
- Worktree:
repo-feature-login/ - Branch:
feature-login
3
Navigate to worktree
Change to your new worktree directory:Your editor should already be open with the new worktree.
Multi-agent parallel development
The real power of GWTree is creating multiple worktrees for parallel AI agent development:The
-x flag (or --no-editor) skips opening editors — perfect for batch creation.- Claude Code in
repo-auth/ - Command Code in
repo-api/ - Cursor in
repo-dashboard/
Fast mode with defaults
Skip all prompts using your saved config:-y or --yes flag uses saved defaults for stash, pull, and editor preferences.
List worktrees
See all worktrees for the current repo:Check status
See the status of all worktrees:- Changed files
- Commits ahead/behind main
- Merge readiness
- Line additions/deletions
Merge and cleanup
When a feature is complete, merge it back to main:- Switches to main branch
- Merges the feature branch
- Removes the worktree
- Deletes the branch
Clean merged worktrees
Remove all worktrees that have been merged to main:Remove specific worktrees
Interactive search and remove:Essential commands
Package manager detection
GWTree automatically detects your package manager:pnpm-lock.yaml→ usespnpm installbun.lockb→ usesbun installyarn.lock→ usesyarn installpackage-lock.json→ usesnpm installpackage.jsononly → defaults topnpm install
What’s next?
You’re ready to use GWTree for parallel AI agent development! Here are some tips:Workflow tip
Use
gwt status frequently to track progress across all worktreesClean habit
Run
gwt clean regularly to remove merged worktreesFast creation
Use
-x flag for batch creation: gwt a b c -xConfiguration
Customize editor and install preferences with
gwt config