Skip to main content
在 Manus 中运行任何 Skill
一键导入

async-doc-hook-autodocs-worktree-locks-branch-checkout

星标2
分支0
更新时间2026年7月8日 11:09

Fix for `git checkout <branch>` failing with `fatal: '<branch>' is already used by worktree at '.../autodocs-<name>'` (or a subagent reviewing a PR reports a path like `.../worktrees/autodocs-<topic>/...`). Use when: (1) right after a commit whose hook printed `[post-commit] Python files changed — running doc update in background...`, a later branch switch is blocked; (2) you can't check out the branch you just committed to because "another worktree" holds it; (3) a review/subagent cites a file path under an `autodocs-*` worktree you never created. Root cause: the async post-commit doc-update hook spawns its OWN git worktree on the active branch (git forbids a branch being checked out in two worktrees). Fix: `git worktree remove --force` the autodocs worktree (after confirming it committed nothing), then checkout proceeds. Distinct from the index.lock variant — see worktree-index-corrupt-async-post-commit-hook.

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

SKILL.md
readonly