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

async-post-commit-hook-commit-orphaned-by-squash-merge

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

In a repo with an ASYNC/background post-commit hook (one that fires after a commit and creates its OWN follow-up commit — `[auto-docs] …`, a docs/site regen, a changelog/checkbox tick), the hook's commit can land LOCAL-ONLY *after* your `git push` already captured just your work commit, so it is never in the PR and gets ORPHANED + silently lost when the squash-merged branch is deleted. Use when: (1) you pushed a fix, PR'd it, and squash-merged, then a later `git status -sb` shows your feature branch is `[ahead 1]` (or ahead N) of its `origin/<branch>` tracking ref even though "everything merged"; (2) that extra commit is authored by a background hook (message prefix `[auto-docs]`, `chore: regenerate …`, no human author intent) and contains REAL content (a corrected design/doc, a regenerated site asset); (3) you're about to delete the merged branch / move on and would lose it. The cause: the hook runs asynchronously ("running doc update in background…"), so `git push -u origin` completes BEFORE the hook commit

安装

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

SKILL.md
readonly