XingLo SkillSearch

Git 合并与变基冲突处理

专门处理正在进行中的 Git merge 或 rebase 冲突。它不会只根据冲突标记机械选择 ours 或 theirs,而是先查看提交历史、PR、Issue 或任务说明,弄清冲突两边各自修改的真实目的,再逐个 hunk 合并;能兼容时保留双方意图,无法兼容时根据本次合并目标做取舍并说明代价。解决后还会自动寻找并运行项目的类型检查、测试和格式化流程,最后完成暂存、提交或继续 rebase,适合复杂分支合并和多人协作冲突处理。

在 AI 中使用此 Skill将本页链接复制给 AI,即可让 AI 获取完整 Skill 内容并按此执行
安全提示: 本站 Skill 均经 ChatGPT 最新模型扫描,未发现恶意脚本及危险指令、未检出已知恶意行为特征,但不保证绝对安全,使用即表示接受此风险

Skill 文件

版本 20260819 · acbb8cf470311b88bedfa71f905fc92d

agents/
SKILL.md
---
name: resolving-merge-conflicts
description: "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.