技能 编程开发 解决 Git 合并冲突

解决 Git 合并冲突

v20260928
resolving-merge-conflicts
此技能用于解决 Git 合并或变基过程中的冲突。它指导用户检查当前状态,识别变更来源,并在保留意图的前提下解决每个冲突块。强调在最终合并前运行自动化检查(如类型检查和测试),确保代码完整性,防止破坏性变更。
获取技能
267 次下载
概览

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.
  1. 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.
  1. 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.
  1. Discover the project's automated checks and run them — typically typecheck, then tests, then format. Fix anything the merge broke.
  1. 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.
信息
分类 编程开发
名称 resolving-merge-conflicts
版本 v20260928
大小 1.77KB
更新时间 2026-09-28
语言