Loading...
Loading...
Git worktree lifecycle management. Use when creating, navigating, syncing, or cleaning up git worktrees for parallel development.
npx skill4agent add scando1993/sugar worktreeNEVER MODIFY FILES IN A WORKTREE YOU DID NOT CREATEgit worktree add <path> -b <branch-name>/tmp/<repo>-worktrees/<name>git worktree listgit statuspwdgit branch# From within the worktree:
git fetch origin
git rebase origin/main # or merge, depending on strategygit worktree remove <path>
git worktree prune| Thought | Reality |
|---|---|
| "I'll just edit files in this other worktree quickly" | Each worktree is an isolated workspace. Switch properly or create a new one. |
| "I don't need to check which worktree I'm in" | Wrong worktree = wrong branch = wrong commits. ALWAYS verify with pwd and git branch. |
| "I'll force-remove this worktree to save time" | Force-remove destroys uncommitted work. Check git status first. |
| "Pruning is optional, I'll do it later" | Stale worktree references cause confusing errors. Prune after every removal. |