worktrees
Git Worktrees
Overview
Git worktrees enable checking out multiple branches simultaneously in separate directories, all sharing the same repository. Create a worktree instead of stashing changes or cloning separately.
Core principle: One worktree per active branch. Switch contexts by changing directories, not branches.
Core Concepts
| Concept | Description |
|---|---|
| Main worktree | Original working directory from git clone or git init |
| Linked worktree | Additional directories created with git worktree add |
Shared .git |
All worktrees share same Git object database (no duplication) |
| Branch lock | Each branch can only be checked out in ONE worktree at a time |
| Worktree metadata | Administrative files in .git/worktrees/ tracking linked worktrees |
Quick Reference
More from glennguilloux/context-engineering-kit
setup-serena-mcp
Guide for setup Serena MCP server for semantic code retrieval and editing capabilities
9tree-of-thoughts
Execute tasks through systematic exploration, pruning, and expansion using Tree of Thoughts methodology with multi-agent evaluation
6write-concisely
Apply writing rules to any documentation that humans will read. Makes your writing clearer, stronger, and more professional.
4setup-arxiv-mcp
Guide for setup arXiv paper search MCP server using Docker MCP
4analyse
Auto-selects best Kaizen method (Gemba Walk, Value Stream, or Muda) for target
3setup-code-formating
Sets up code formatting rules and style guidelines in CLAUDE.md
3