← 教程列表
news

Only after merge succeeds: remove worktree, then delete branch (Bug #999 fix)

📅 2026/6/12 16:30:02⏱ 约 5 分钟阅读👁 8 阅读

git worktree remove "$WORKTREE_PATH" # only if superpowers owns it git branch -d ``` The order is critical: merge → verify → remove worktree → delete branch. The old skill deleted the branch before removing the worktree (which fails because the worktree still references the branch). The naive fix of removing the worktree first is also wrong — if the merge then fails, the working directory is gone and changes are lost. **Option 2 (Create PR):** Push branch, create PR. Do NOT clean up worktree — user needs it for PR iteration. (Bug #940 fix: remove contradictory "Then: Cleanup worktree" prose.) **Option 3 (Keep as-is):** No action. **Option 4 (Discard):** Require typed "discard" confirmation. Then remove worktree (if superpowers owns it), force-delete branch.

← 返回教程列表 AI8899 · 内容仅供学习参考