git-worktree
Installation
SKILL.md
Git worktree manager
Always use the manager script
Never call git worktree add directly -- always use the worktree-manager.sh script.
The script handles critical setup that raw git commands don't:
- Copies
.env,.env.local,.env.test, etc. from main repo - Ensures
.worktreesis in.gitignore - Creates consistent directory structure
- After creation, install dependencies if detected:
package.json→npm install,composer.json→composer install,pyproject.toml→pip install -e .,go.mod→go mod download
Safety Verification
Before creating a worktree, verify the worktree directory is gitignored:
# Verify .worktrees is ignored (should output ".worktrees")
git check-ignore .worktrees || echo "WARNING: .worktrees not in .gitignore"
Related skills