git-conflicts
Resolve merge/rebase/cherry-pick conflicts: understand both sides, resolve minimally, verify with tests. No blind ours/theirs.
SKILL.mdskills/git/git-conflicts/SKILL.md
GitHubgit-conflicts
Conflicts are review decisions, not typing exercises: understand intent on both sides first.
Inspection
Read both sides' intent (log --merge) and the conflicted hunks before touching anything; note which side the PR's purpose favors.
Decision rules
Resolve per hunk with intent preserved; never blanket ours/theirs on unread code; abort and split when the surface exceeds understanding.
Activate when
- Merge, rebase, or cherry-pick stops with conflicts.
Do NOT activate for
- Clean merges/rebases (git-workflow, git-rebase) or lost work (git-recovery).
Procedure
- Orient:
git statusfor conflicted paths;git log --merge --onelinefor both sides' intent. - Resolve per hunk: keep the intent of both where compatible; where incompatible, choose the side matching the PR's purpose and note why. Never blanket
ours/theirson code you haven't read. - Mark resolved (
git add), continue (--continue), and re-run the affected tests before pushing. - Abort criteria: if the conflict surface exceeds understanding,
git merge --abort/git rebase --abortand split the change smaller. - Verify: full diff re-read, tests green, no conflict markers (
grep -r '<<<<<<<').
Failure modes
Auto-resolving with ours/theirs; resolving without running tests; leaving markers in; pushing conflicted merges to shared branches.
Escalation
Lost work during resolution → git/git-recovery.