# GIT Worktrees

Use when working on multiple branches simultaneously, context switching without...

- Repository: https://github.com/NeoLabHQ/context-engineering-kit (1797 stars)
- Category: Testing
- License: GPL-3.0
- Last updated: 2026-08-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add NeoLabHQ/context-engineering-kit --skill git-worktrees -g -a claude-code -y`
Codex: `npx skills add NeoLabHQ/context-engineering-kit --skill git-worktrees -g -a codex -y`
Cursor: `npx skills add NeoLabHQ/context-engineering-kit --skill git-worktrees -g -a cursor -y`
Gemini CLI: `npx skills add NeoLabHQ/context-engineering-kit --skill git-worktrees -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add NeoLabHQ/context-engineering-kit`

## Description

Use when working on multiple branches simultaneously, context switching without stashing, reviewing PRs while developing, testing in isolation, or comparing implementations across branches - provides git worktree commands and workflow patterns for parallel development with multiple working directories.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

The rest: https://github.com/NeoLabHQ/context-engineering-kit/blob/HEAD/antigravity/skills/git-worktrees/SKILL.md
