
Git Worktrees
When you need to review a PR while keeping your feature work untouched, or run long tests on main while continuing development, worktrees let you check out multiple branches simultaneously in separate directories. Instead of stashing or cloning, you get parallel working directories that share the same Git database. The skill covers the essential commands (add, remove, list, prune) plus practical patterns like comparing implementations side by side, cherry-picking specific commits between worktrees, and maintaining a locked reference checkout of main. The one gotcha: each branch can only be checked out in one worktree at a time, so you can't accidentally work on the same branch in two places.
- skills.sh installs
- 1.2K
- GitHub stars
- 1.8K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add neolabhq/context-engineering-kit --skill git-worktrees --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
Sponsors
Details
- Repository
- github.com/neolabhq/context-engineering-kit
- Categories
- Testing & QA, Git & Pull Requests, Automation & Workflows
- First seen
- Jun 3, 2026
More from neolabhq/context-engineering-kit
All 63- Decay1.2K
- Attach Review To Pr1.2K
- Git Notes1.2K
- Setup Arxiv Mcp1.2K
- Propose Hypotheses1.2K
- Build Mcp1.2K
- Load Issues1.2K
- Create Workflow Command1.2K
- Query1.2K
- Status1.2K
- Reset1.2K
- Setup Context7 Mcp1.2K
- Prompt Engineering1.5K
- Context Engineering1.5K
- Thought Based Reasoning1.4K
- Reflect1.4K
- Write Concisely1.4K
- Kaizen1.4K
- Multi Agent Patterns1.4K
- Memorize1.3K
- Update Docs1.3K
- Critique1.3K
- Brainstorm1.3K
- Judge With Debate1.3K