git-worktree-workflows
Git Worktree Workflows
Master Git worktrees using the gw CLI tool for optimized parallel development workflows.
Rules
| Rule | Description |
|---|---|
| fundamentals | HIGH - Core concepts of Git worktrees, what they share/don't share, when to use them |
| creation | HIGH - Creating worktrees with gw add, remote fetch behavior, auto-copy files |
| navigation | MEDIUM - Navigating with gw cd and gw checkout, shell integration setup |
| inspection | LOW - Listing worktrees with gw list, understanding worktree states |
| cleanup | MEDIUM - Removing worktrees, gw clean, gw prune, disk space management |
| troubleshooting | HIGH - Common errors and solutions, recovery procedures |
Workflow Patterns
| Pattern | Description |
|---|---|
| feature-branch | HIGH - Feature development workflow with worktrees |
| hotfix | HIGH - Urgent bug fixes without interrupting feature work |
| code-review | HIGH - Review PRs in isolated environments with gw pr |
| parallel-testing | MEDIUM - Test across Node versions or configurations |
Quick Reference
| Task | Command |
|---|---|
| Create worktree | gw add feature-name |
| Create from different branch | gw add feature-name --from develop |
| Create from staged files | gw checkout feature-name --from-staged |
| Navigate to worktree | gw cd feature-name |
| List all worktrees | gw list |
| Remove worktree | gw remove feature-name |
| Check out PR | gw pr 123 |
| Update with main | gw update |
| Batch cleanup | gw clean |
| Full cleanup | gw prune |
Key Principles
- Use worktrees for parallel work: Keep main ready while developing features.
- Always use
gw add: Gets auto-copy, shell navigation, smart fetch. - One branch per worktree: Cannot check out same branch in multiple worktrees.
- Clean up when done: Use
gw remove,gw clean, orgw prune.
Related Skills
- gw-config-management - Configure auto-copy files and hooks
- autonomous-workflow - Autonomous development in isolated worktrees
Resources
More from mthines/gw-tools
autonomous-workflow
>
34gw-config-management
>
27@gw-config-management
>
17@gw-git-worktree-workflows
Master Git worktrees and gw-tools workflows for parallel development. Use this skill when creating worktrees, managing multiple branches simultaneously, navigating between worktrees, troubleshooting worktree issues, or setting up feature branch workflows. Triggers on tasks involving git worktree commands, branch isolation, parallel development, or gw CLI usage.
17@gw-autonomous-workflow
Autonomous feature development workflow using isolated worktrees. Use this skill to autonomously implement features from task description through tested PR delivery. Handles worktree creation, implementation, testing, iteration, documentation, and PR creation. Triggers on requests for autonomous feature development, end-to-end implementation, or "implement X feature autonomously.
15@gw-multi-worktree-dev
Advanced patterns for developing across multiple Git worktrees simultaneously. Use this skill when managing dependencies across worktrees, synchronizing files, handling databases for multiple branches, running parallel tests, or orchestrating services across worktrees. Triggers on tasks involving multi-branch development, dependency sharing, database isolation, or service orchestration with gw.
4