---
id: gh-resolving-merge-conflicts
name: "resolving-merge-conflicts"
url: https://skills.yangsir.net/skill/gh-resolving-merge-conflicts
author: mattpocock
domain: ai-dev-tools-workflow
tags: ["git", "merge-conflict", "rebase", "version-control", "developer-workflow"]
install_count: 551100
rating: 4.90 (120 reviews)
github: https://github.com/mattpocock/skills/tree/main/skills/engineering/resolving-merge-conflicts
---

# resolving-merge-conflicts

> 此技能提供了一套系统化的方法来高效解决 Git 合并或变基（rebase）过程中出现的冲突。它指导开发者逐步检查历史、识别冲突根源、精确处理每个冲突块，并确保自动化检查通过，从而显著减少手动解决冲突的耗时和错误，保障代码库的整洁与项目的顺利推进。

**Stats**: 551,100 installs · 4.9/5 (120 reviews)

## Before / After 对比

### 解决合并冲突效率

**Before**:

用户在没有明确指导的情况下，手动解决 Git 合并冲突时，往往耗时冗长，容易遗漏关键修改或引入新的错误，导致代码库不稳定，甚至需要多次返工，严重影响开发效率和团队协作。

**After**:

该 Skill 提供清晰的步骤和最佳实践，帮助开发者快速定位并准确解决冲突。此技能确保每次冲突解决都遵循规范，减少了返工和错误，显著提升了代码合并的成功率和开发流程的顺畅度。

| Metric | Before | After | Change |
|---|---|---|---|
| 解决冲突耗时 | 60分钟 | 10分钟 | -83% |

## Readme

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.


---
*Source: https://skills.yangsir.net/skill/gh-resolving-merge-conflicts*
*Markdown mirror: https://skills.yangsir.net/api/skill/gh-resolving-merge-conflicts/markdown*