Using Git Worktrees

用于需要隔离开发环境的工程任务:当用户要并行做多个需求、明确说“单独开分支做”“不要污染当前工作区”“给这个任务单独开一套目录”,或任务会持续较久并改动多个文件时使用。Prefer `planning-with-files` when 任务还没拆清;Combine with `git-commit` / `github-pr-creation` / `verification-before-completion` when 需要形成完整工程闭环;Do not use for 小改动、纯研究或只改文案的任务。

hebertzhu f52b0e5 1.6 KB Updated

File contents

using-git-worktrees

Intent

  • 用于需要隔离开发环境的工程任务:当用户要并行做多个需求、明确说“单独开分支做”“不要污染当前工作区”“给这个任务单独开一套目录”,或任务会持续较久并改动多个文件时使用。Prefer planning-with-files when 任务还没拆清;Combine with git-commit / github-pr-creation / verification-before-completion when 需要形成完整工程闭环;Do not use for 小改动、纯研究或只改文案的任务。

Default operating pattern

  1. Capture the actual engineering goal and the next decision that matters.
  2. Inspect the current code, tests, branch state, or CI context before acting.
  3. Take the smallest next action that reduces uncertainty or advances delivery.
  4. Collect fresh evidence before claiming progress.
  5. Summarize status, risks, and the next recommended step.

Pack fit

  • Included in: engineering-workflow
  • Keep examples generic, privacy-safe, and portable across hosts.

Boundary

  • Do not use for tiny single-file edits that do not justify extra setup.

hebertzhu/agent-foundry/tree/main/skills/using-git-worktrees commit f52b0e5489

Frequently asked questions

npx skillmds@latest add hebertzhu/using-git-worktrees