Creating Worktrees

Create repo-local Git worktrees under .worktrees/.

darknesskiller 4f22d94 2 files · 992 B Updated

File contents

Creating Worktrees

Steps

  1. Find repo root: git rev-parse --show-toplevel.
  2. Get branch or task name; ask once if missing.
  3. Sanitize slug: replace /, spaces, unusual chars with -.
  4. Add .worktrees/ to $(git rev-parse --git-path info/exclude) if missing.
  5. Create: existing branch → git worktree add <path> <branch>; new branch → git worktree add -b <branch> <path>.
  6. codegraph init <path> only when source has .codegraph/ or user asks. Else CodeGraph: not applicable.
  7. 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.

darknesskiller/skills/tree/main/skills/engineering/creating-worktrees commit 4f22d94dd2

Frequently asked questions

npx skillmds@latest add darknesskiller/creating-worktrees