Git worktrees revolutionize feature development by giving each feature its own isolated directory. Work on multiple features simultaneously without branch switching, stashing, or context loss.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ahmadawais/gwtree/llms.txt
Use this file to discover all available pages before exploring further.
The Problem with Traditional Workflow
Traditional git workflow forces you to:- Switch branches constantly
- Stash uncommitted changes
- Lose IDE context and open files
- Reinstall dependencies after switching
- Close and reopen terminals
Feature Development Flow
Start a new feature
Create a worktree for your feature:This creates:
- A new branch:
feature-login - A new directory:
repo-feature-login/ - Pulls latest from main automatically
Switch to another feature
Need to work on something else? Just create another worktree:The
-x flag skips opening an editor. Your first feature stays untouched:- All files exactly as you left them
- Dev server still running
- No stashing needed
Check status across features
View progress on all your features:Output shows:
- Uncommitted changes in each worktree
- Commits ahead/behind main
- Merge status
Common Scenarios
Multiple Related Features
Work on related features in parallel:Develop all three simultaneously, test interactions between them.
Feature + Hotfix
Feature work interrupted by urgent bug:Your feature work remains untouched.
Long-Running Features
Keep long-running feature branches fresh:
Experimental Work
Try risky changes without fear:
Fast Creation Modes
Quick Mode
Create worktree with a single name:Fast Mode (Skip Prompts)
Use-y to skip all prompts and use saved defaults:
Batch Mode
Create multiple worktrees at once:Ultra-Fast Mode
Combine flags for instant creation:Configuration Tips
Set your preferred editor globally:code- VS Codecursor- Cursornone- Don’t open editordefault- System default
~/.config/gwtree/config.json:
Cleaning Up
Remove merged features
Remove merged features
Clean up features that have been merged to main:Safely removes only merged worktrees.
Remove all worktrees
Remove all worktrees
Start fresh by removing all worktrees:Use with caution - removes all worktrees including unmerged work.
Remove specific worktree
Remove specific worktree
Interactive search and remove:Select the worktree to remove from a list.
List all worktrees
List all worktrees
See all your worktrees:
Best Practices
Keep main worktree clean - Use the main repository directory for quick checks and worktree management only.
Troubleshooting
Port already in use
Port already in use
Each worktree can run its own dev server on a different port:
Dependencies out of sync
Dependencies out of sync
Each worktree has its own
node_modules:Merge conflicts
Merge conflicts
If you encounter conflicts when merging:
Next Steps
Parallel Agents
Run multiple AI agents simultaneously on different features.
Code Review
Review PRs without disrupting your current work.