# 081 Troubleshooting Bfc2a3f0

> Worktree Troubleshooting (Agent Reference)

- Skill: `tools-only/081-troubleshooting-bfc2a3f0` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/081-troubleshooting-bfc2a3f0`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/081-troubleshooting-bfc2a3f0/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/tools-only/081-troubleshooting-bfc2a3f0

---

# Worktree Troubleshooting (Agent Reference)

## Common errors

- **"not a git repository"**
  - You are not in `main/`. Change to the repo root and retry.

- **"fatal: A branch named 'X' already exists"**
  - Use `git worktree add <path> <branch>` without `-b`.

- **"worktree already exists" / path exists**
  - Pick a new directory name or remove the old worktree:
    `git worktree remove <path>`

- **"locked" worktree**
  - Run `git worktree prune` and retry.

- **Uncommitted changes block checkout**
  - Commit, stash, or clean the working tree before creating a new worktree.

## Clean up

```
git worktree list
git worktree prune
```

