using-git-worktrees

Creates isolated git worktrees for parallel development. Use when starting feature work needing isolation or working on multiple branches simultaneously. Not for simple branch switching or basic git operations.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "using-git-worktrees" with this command: npx skills add alexei-led/claude-code-config/alexei-led-claude-code-config-using-git-worktrees

Git Worktrees

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously.

Quick Start

# Create worktree as sibling directory (best practice)
git worktree add ../myproject-feature-auth -b feature/auth

# Create from existing branch
git worktree add ../myproject-bugfix-123 bugfix/issue-123

# List all worktrees
git worktree list

# Remove when done
git worktree remove ../myproject-feature-auth

# Clean up stale entries
git worktree prune

Directory Strategy

Worktrees are created as sibling directories to the main repo (not inside it):

~/projects/
├── myproject/                    # main worktree (main branch)
├── myproject-feature-auth/       # linked worktree
└── myproject-hotfix-login/       # linked worktree

Why siblings, not children:

  • No .gitignore pollution — worktree is outside the repo
  • Cleaner git status — no risk of tracking worktree contents
  • Standard practice endorsed by git docs and community
  • Each worktree has independent build artifacts, node_modules, etc.

Naming Convention

<project>-<branch-slug> — self-documenting, instantly shows purpose.

BranchWorktree Directory
feature/auth../myproject-feature-auth
bugfix/issue-123../myproject-bugfix-123
experiment/v2../myproject-experiment-v2

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

brainstorming-ideas

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

testing-e2e

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

refactoring-code

No summary provided by upstream source.

Repository SourceNeeds Review