Skip to main content

7 posts tagged with "Git"

View All Tags
· 5 min read

git worktree 让多分支并行工作,一个目录 = 一个分支

  • 核心机制:所有 worktree 共享一个 .git 数据库
  • 典型场景:边修 bug 边开发 feature,不切分支
  • code review:独立目录看 PR,不打断当前工作
  • 跑长任务:CI、build 不阻塞主工作区
  • superpowers 模式一个 worktree 一个 agent,并行的关键
  • 使用注意同一分支只能被一个 worktree checkout
  • 清理规则:删目录不够,必须 git worktree remove