using-git-worktrees
Installation
SKILL.md
Using Git Worktrees
Git worktrees create isolated workspaces sharing the same repository. This allows work on multiple branches simultaneously without switching branches or stashing changes in the primary directory.
Core Principle: Systematic directory isolation + safety verification = risk-free experimental development.
Purpose
Prevents catastrophic mistakes on the main branch. When executing a massive refactoring or risky implementation, you should use an isolated worktree. If the code completely breaks in the worktree, the original directory remains unharmed.
When to Use Include
- When running
subagent-driven-developmentor dispatching background tasks. - When creating massive, potentially breaking feature changes.
- When you need to test something out without messing up the current
git status.
Directory Selection & Safety Workflow
1. Check & Use Existing .worktrees Directory
Check if .worktrees or worktrees exists in the local project root.