OpenParable
Skip to content
← Back to skills

Resolving Merge Conflicts

Development
resolving-merge-conflicts

Resolving Merge Conflicts is an Agent Skill for development published in the vinvcn/mattpocock-skills-zh-CN repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

适用于需要解决正在进行的 git merge/rebase 冲突时。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/vinvcn/mattpocock-skills-zh-CN/blob/HEAD/skills/engineering/resolving-merge-conflicts/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/resolving-merge-conflicts, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

  1. 查看当前 merge/rebase 状态。检查 git history 和冲突文件。

  2. 为每个冲突找到 primary sources。深入理解每个变更为什么产生,以及原始意图是什么。阅读 commit messages,检查 PRs,检查原始 issues/tickets。

  3. 解决每个 hunk。 尽可能保留双方意图。若二者不兼容,选择符合本次 merge 目标的一方,并记录 trade-off。不要发明新行为。始终解决冲突;不要 --abort。

  4. 发现项目的 automated checks 并运行它们,通常是 typecheck、tests、format。修复 merge 引入的问题。

  5. 完成 merge/rebase。 Stage 所有内容并 commit。若正在 rebase,继续 rebase 流程直到所有 commits 都完成。