Resolving Merge Conflicts

作者 mattpocockc55ee46073ed无许可证收录于 2026年10月8日更新于 2026年10月8日

Use when you need to resolve an in-progress git merge/rebase conflict.

AI 生成的概览

指导代理逐步解决进行中的 git 合并或变基冲突。

功能
该技能提供一套五步流程,用于解决进行中的 git 合并或变基冲突。内容包括检查当前状态与冲突文件、通过提交信息、拉取请求和工单追溯每处冲突的原始意图、在可能时保留双方意图逐块解决冲突、运行项目的自动化检查,以及通过暂存和提交完成合并或变基。它仅包含说明,产出的是已完成并提交的合并或变基,而非文件产物。
适用场景
适用于 git 合并或变基已在进行中并留下待解决冲突文件的场景。也适合代理需要判断如何协调相互冲突的改动,并用项目自身的检查验证结果的情况。
运行要求
需要一个存在进行中合并或变基的 git 仓库,并能访问 git 历史、提交信息、拉取请求和工单。运行项目的自动化检查需要项目所用的工具,例如类型检查器、测试套件和格式化工具。该技能不附带脚本,仅为说明。
  1. See the current state of the merge/rebase. Check git history, and the conflicting files.

  2. Find the primary sources for each conflict. Understand deeply why each change was made, and what the original intent was. Read the commit messages, check the PRs, check original issues/tickets.

  3. Resolve each hunk. Preserve both intents where possible. Where incompatible, pick the one matching the merge's stated goal and note the trade-off. Do not invent new behaviour. Always resolve; never --abort.

  4. Discover the project's automated checks and run them, typically typecheck, then tests, then format. Fix anything the merge broke.

  5. Finish the merge/rebase. Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased.

来源与署名

来源:mattpocock/skills位于skills/engineering/resolving-merge-conflicts提交c55ee46

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架