using-git-worktrees
23
总安装量
13
周安装量
#16291
全站排名
安装命令
npx skills add https://github.com/julianobarbosa/claude-code-skills --skill using-git-worktrees
Agent 安装分布
opencode
9
claude-code
9
gemini-cli
8
cursor
8
antigravity
7
Skill 文档
Git Worktrees
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously.
Announce at start: “I’m using the using-git-worktrees skill to set up an isolated workspace.”
Quick Start
# Create worktree with new branch
git worktree add .worktrees/feature-auth -b feature/auth
# Create worktree from existing branch
git worktree add .worktrees/bugfix bugfix/issue-123
# List worktrees
git worktree list
# Remove worktree
git worktree remove .worktrees/feature-auth
Directory Selection
- Check existing:
.worktrees/orworktrees/ - Check CLAUDE.md for preference
- Ask user if neither exists
Safety Requirements
Before creating project-local worktree:
# Verify directory is in .gitignore
grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignore
If NOT in .gitignore: Add it immediately and commit.
References
- WORKFLOW.md – Detailed workflow steps
- scripts/ – Helper scripts