Creating Worktrees
Steps
- Find repo root:
git rev-parse --show-toplevel. - Get branch or task name; ask once if missing.
- Sanitize slug: replace
/, spaces, unusual chars with-. - Add
.worktrees/to$(git rev-parse --git-path info/exclude)if missing. - Create: existing branch →
git worktree add <path> <branch>; new branch →git worktree add -b <branch> <path>. codegraph init <path>only when source has.codegraph/or user asks. ElseCodeGraph: not applicable.- Report path, branch, exclude status, CodeGraph result.
Output
End with a short report covering Report path/branch, Sanitized slug, Worktree exists, Exclusion, and CodeGraph status.
Completion: worktree exists, branch correct, exclusion recorded, CodeGraph reported.