Resolving Merge Conflicts

by vinvcn3f92a83668efNo license4.6K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated today

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

Instructions onlySoftware Development
AI-generated overview

Guides an agent through resolving an in-progress git merge or rebase conflict step by step.

What it does
This skill provides a five-step procedure for handling an active git merge or rebase conflict. It has the agent inspect the current merge/rebase state and conflicting files, trace each change back to its primary sources such as commit messages, pull requests, and original issues, then resolve each hunk while preserving both sides' intent where possible. It also directs the agent to find and run the project's automated checks, fix merge-introduced problems, and finish the merge or rebase by staging and committing. It ships no scripts; it is instructions only.
When to use it
Use it when a git merge or rebase is already in progress and conflicts must be resolved. It fits situations where the agent needs to understand why each side changed before choosing a resolution, and where the merge should be completed rather than aborted.
Requirements
A git repository with an in-progress merge or rebase and access to its history, commit messages, pull requests, and issues. The project's automated checks (typecheck, tests, format) should be runnable. No scripts are included; the skill is instructions only.
  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 都完成。

Source and attribution

Source:vinvcn/mattpocock-skills-zh-cninskills/engineering/resolving-merge-conflictsat commit3f92a83

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal