resolving-merge-conflicts
vinvcn/mattpocock-skills-zh-cn
Resolve git merge/rebase conflicts by understanding intent and preserving both sides when compatible.
What is resolving-merge-conflicts?
Guidance for resolving in-progress git merge and rebase conflicts. Use this when you encounter conflicting changes and need to integrate them thoughtfully while maintaining project integrity.
- Examine merge/rebase state and identify conflicting files
- Trace original intent by reading commit messages, PRs, and issues
- Resolve each conflict hunk while preserving compatible changes from both sides
- Run automated checks (typecheck, tests, format) to catch merge-introduced issues
- Complete the merge/rebase by staging and committing all changes
How to install resolving-merge-conflicts
npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill resolving-merge-conflictsHow to use resolving-merge-conflicts
- 1.Check the current merge/rebase status and review git history
- 2.For each conflicting file, identify the primary sources of change by reading commit messages, PRs, and related issues
- 3.Resolve each conflict hunk by preserving both sides' intent when compatible; if incompatible, choose the approach aligned with the merge goal and document the trade-off
- 4.Run the project's automated checks (typecheck, tests, format) and fix any issues introduced by the merge
- 5.Stage all resolved files and complete the merge with a commit, or continue the rebase process until all commits are processed
Use cases
- Integrating feature branches with conflicting changes to the same files
- Rebasing a branch onto an updated main branch with overlapping edits
- Merging pull requests that modify the same code sections
- Resolving conflicts during team collaboration on shared codebases
- Completing a rebase workflow after fixing individual commit conflicts
- Software developers managing git workflows
- Team leads integrating multiple feature branches
- Engineers resolving conflicts during code reviews
- Anyone performing git merge or rebase operations
resolving-merge-conflicts FAQ
No. Always resolve conflicts rather than aborting. Take time to understand the original intent behind each change by examining commit messages, PRs, and issues.
Choose the approach that aligns with the current merge goal and document the trade-off in your commit message or comments.
No. Never invent new behavior. Only combine or choose from the existing changes on both sides.
Run your project's standard checks: typecheck, tests, and format. These catch issues introduced during the merge process.
Full instructions (SKILL.md)
Source of truth, from vinvcn/mattpocock-skills-zh-cn.
name: resolving-merge-conflicts description: "适用于需要解决正在进行的 git merge/rebase 冲突时。"
-
查看当前 merge/rebase 状态。检查 git history 和冲突文件。
-
为每个冲突找到 primary sources。深入理解每个变更为什么产生,以及原始意图是什么。阅读 commit messages,检查 PRs,检查原始 issues/tickets。
-
解决每个 hunk。 尽可能保留双方意图。若二者不兼容,选择符合本次 merge 目标的一方,并记录 trade-off。不要发明新行为。始终解决冲突;不要
--abort。 -
发现项目的 automated checks 并运行它们,通常是 typecheck、tests、format。修复 merge 引入的问题。
-
完成 merge/rebase。 Stage 所有内容并 commit。若正在 rebase,继续 rebase 流程直到所有 commits 都完成。
Related skills
More from vinvcn/mattpocock-skills-zh-cn and the wider catalog.

scaffold-exercises
Scaffold exercise directory structures with chapters, problems, solutions, and explanations that pass linting.

setup-matt-pocock-skills
Configure repository settings for Matt Pocock's engineering skills: issue tracker, triage labels, and domain docs layout.

setup-pre-commit
Set up Husky pre-commit hooks with lint-staged, Prettier, type checking, and tests.

setup-ts-deep-modules
Enforce deep module boundaries in TypeScript monorepos using dependency-cruiser.

tdd
Test-Driven Development: write failing tests first, then minimal code to pass them.

teach
Create a structured learning workspace to teach users new skills or concepts with lessons, references, and progress tracking.