git-worktree-workflows
Installation
SKILL.md
Git Worktree Workflows
Master Git worktrees using the gw CLI tool for optimized parallel development workflows.
MANDATORY: Always Use gw, Never Raw git worktree
Non-negotiable in any repo where gw is installed. Check with which gw; if missing, suggest brew install mthines/gw-tools/gw or npm install -g @gw-tools/gw.
| Instead of | Use | Why it matters |
|---|---|---|
git worktree add ../feat feat |
gw checkout feat |
Auto-copies files, runs hooks, remote probe, auto-cd |
git worktree remove feat |
gw remove feat |
Prunes orphan branch, protects main |
git checkout -b feat |
gw checkout feat |
Isolated worktree instead of in-place branch switch |
git checkout main (when main is another wt) |
gw checkout main |
Detects existing worktree and navigates instead of erroring |
cd ../feat |
gw cd feat |
Partial matching, works from any depth |
git fetch && git checkout pr-branch |
gw pr <number> |
Handles fork PRs, auto-copies, runs hooks |
Manually cp ../main/.env .env after worktree |
Configure autoCopyFiles in gw init |
One-time setup, auto-copies forever after |