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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Git 出现了冲突,帮我解决一下。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会先分析你代码的当前状态,通过阅读提交信息和历史记录,弄清导致冲突的改动是什么。然后它会帮你决定如何合并这些部分,同时保留代码的主要目标。最后,它会检查一切是否仍然正常运行,并完成整个流程。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
When to Use
Use when you need to resolve an in-progress git merge/rebase conflict.
See the current state of the merge/rebase. Check git history, and the conflicting files.
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.
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.Discover the project's automated checks and run them — typically typecheck, then tests, then format. Fix anything the merge broke.
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.
热度
- GitHub 星标
- 48k
- 排名
- #5623
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。