# Git Worktree

> Manage Git worktrees for isolated parallel development. Use when you want a clean branch/worktree without stashing or when reviewing in isolation. Use when this capability is needed.

- Skill: `tomevault-io/git-worktree-12` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/git-worktree-12`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/git-worktree-12/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/git-worktree-12

---


# Git Worktree Manager

This skill ships a helper script:
- `scripts/worktree-manager.sh`

It wraps `git worktree` and also:
- keeps worktrees under `.worktrees/`
- copies common `.env*` files from the main repo into new worktrees
- ensures `.worktrees/` is in `.gitignore`

## Usage

### Create a worktree

```bash
bash scripts/worktree-manager.sh create <branch-name> [from-branch]
```

Example:

```bash
bash scripts/worktree-manager.sh create feat-login main
```

### List worktrees

```bash
bash scripts/worktree-manager.sh list
```

### Switch (prints target path)

```bash
bash scripts/worktree-manager.sh switch <branch-name>
```

### Copy env files into an existing worktree

```bash
bash scripts/worktree-manager.sh copy-env <branch-name>
```

### Cleanup inactive worktrees

```bash
bash scripts/worktree-manager.sh cleanup
```

## Notes

- Prefer using this script instead of calling `git worktree add` directly.
- If your default branch is not `main`, pass it explicitly as `from-branch`.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/sammyjoyce) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

