跳到正文
Skillpedia
部署与云(DevOps)48k · #5623

resolving-merge-conflicts

它能做什么

这个工具可以帮你解决代码合并时出现的冲突。当你尝试合并不同版本的代码时,难免会遇到这种情况。它会引导你理解各处改动,并把它们正确地结合起来。

适用场景

  • ✓当 Git 在合并代码后提示存在冲突时。
  • ✓当你需要检查哪些文件有问题,以及每个文件改了什么时。
  • ✓当你需要决定保留哪个代码版本,或者如何把两者结合起来时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/resolving-merge-conflicts/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/resolving-merge-conflicts/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我的 Git 出现了冲突,帮我解决一下。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会先分析你代码的当前状态,通过阅读提交信息和历史记录,弄清导致冲突的改动是什么。然后它会帮你决定如何合并这些部分,同时保留代码的主要目标。最后,它会检查一切是否仍然正常运行,并完成整个流程。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

When to Use

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

  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.

Example

User request:

Use @resolving-merge-conflicts for this task: Use when you need to resolve an in-progress git merge/rebase conflict.

Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
  • Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
常见问题

什么是合并/变基冲突?

当两个版本的代码修改了同一部分,而且修改方式不同,Git 无法自动把它们合并在一起,这时就会出现冲突。

“解决每个 hunk”是什么意思?

hunk 指的是一段包含改动的代码块。解决它,就是决定保留这一段的哪个版本,或者如何把两个版本结合起来。

为什么不能自己发明新的行为?

目标是合并这些改动原本的意图,而不是另外创造新东西。随意发明可能会破坏原本正常工作的功能,或者偏离项目的目标。

详情

作者的原始描述

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

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5623
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能