resolving-merge-conflicts

Resolves git merge, rebase, and cherry-pick conflicts by preserving both sides' intent.

20|2|Updated May 16, 2026
One-click install
npx skills add https://github.com/reddb-io/red-skills --skill resolving-merge-conflicts-reddb-io
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: resolving-merge-conflicts
Source: https://github.com/reddb-io/red-skills/tree/main/plugins/dev/skills/engineering/resolving-merge-conflicts
Command: npx skills add https://github.com/reddb-io/red-skills --skill resolving-merge-conflicts-reddb-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Merge conflicts during git merges, rebases, and cherry-picks often get resolved by blindly picking one side, silently discarding the other branch's work. This Skill enforces a disciplined resolution loop that understands why each side changed the code before reconciling them. ## Core Features & Use Cases - Intent-Preserving Resolution: Reads each side's diff against the merge base and traces commit messages, PRs, or issues to explain both changes before editing any hunk. - Operation-Aware Semantics: Distinguishes merge, rebase, and cherry-pick states (MERGE_HEAD, REBASE_HEAD, CHERRY_PICK_HEAD) so "ours" and "theirs" are interpreted correctly. - Verification Before Completion: Discovers the project's test, lint, and build commands from package.json, Makefile, README, or CI config and runs them before staging and continuing the operation. - Use Case: During a rebase, a teammate's retry-backoff refactor conflicts with your cache-invalidation fix on the same lines. The Skill walks you through both diffs, produces a merged hunk honoring both intents, runs the test suite, and continues the rebase with a commit message naming both reconciled changes. ## Quick Start Resolve the merge conflicts in my current git rebase, preserving the intent of both sides and running the project checks before continuing.

Frequently Asked Questions about resolving-merge-conflicts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I resolve git merge conflicts without losing either side's changes?▼

Read each side's diff against the merge base with git diff ORIG_HEAD...HEAD and git diff MERGE_HEAD...HEAD, identify why each branch changed the lines, then write a merged hunk that achieves both intentions. Run the project's tests before staging and continuing.

How to resolve conflicts during a git rebase versus a merge?▼

During a rebase, "ours" is the new base and "theirs" is the commit being replayed, which is the reverse of merge intuition. Check for REBASE_HEAD versus MERGE_HEAD in git status to identify the operation, then interpret the conflict markers accordingly.

What does the diff3 conflict style show in git?▼

Enable it with git config merge.conflictstyle diff3. Conflict blocks then show a third section marked with ||||||| containing the merge-base version, so you can see what the file looked like before either branch modified it.

Can git resolve conflicts in binary files automatically?▼

No, git cannot insert text conflict markers into binary files. Extract both versions with git show HEAD:<file> and git show MERGE_HEAD:<file>, choose or manually merge the correct version with an appropriate tool, then stage the result.

Why should I avoid git checkout --ours or --theirs to fix conflicts?▼

Accepting one side wholesale discards the other branch's work without verifying its intent is preserved. Only use these flags after confirming the discarded side's changes are truly redundant or already represented in the kept version.

When is it acceptable to abort a merge or rebase instead of resolving?▼

This Skill treats aborting as off-limits because git merge --abort, rebase --abort, and cherry-pick --abort discard in-progress work. The correct path is to resolve every hunk, run the project checks, and continue the operation.