Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
girijashankarj avatar

Git Conflict Resolver

  • 1 installs
  • 27 repo stars
  • Updated April 25, 2026
  • girijashankarj/cursor-handbook

Systematic workflow to understand both sides of git merge conflicts, classify them, choose the right resolution, and validate the result.

About

Safely resolves git merge, rebase, and cherry-pick conflicts by understanding both sides and validating the outcome. A developer uses it when facing unmerged paths during a merge or rebase.

  • Classifies conflicts as trivial, additive, or competing
  • Reads conflict markers to understand ours vs theirs

Git Conflict Resolver by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #527 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
  • Data as of Jul 22, 2026 (Skillselion catalog sync)
npx skills add https://github.com/girijashankarj/cursor-handbook --skill git-conflict-resolver

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars27
Last updatedApril 25, 2026
Repositorygirijashankarj/cursor-handbook

What it does

Systematic workflow to understand both sides of git merge conflicts, classify them, choose the right resolution, and validate the result.

Files

SKILL.mdMarkdownGitHub ↗

Skill: Git Conflict Resolver

Safely resolve git merge conflicts by understanding both sides, choosing the correct resolution, and validating the result.

Trigger

When the user reports merge conflicts, rebase conflicts, or asks for help resolving git conflicts.

Prerequisites

  • [ ] Active merge or rebase in progress (git status shows "Unmerged paths")
  • [ ] Understanding of the intended behavior of both branches

Steps

Step 1: Assess the Situation

  • [ ] Run git status to list all conflicted files
  • [ ] Determine the operation: merge, rebase, or cherry-pick
  • [ ] Identify source and target branches
  • [ ] Count total conflicts: git diff --name-only --diff-filter=U

Step 2: Understand Each Conflict

For each conflicted file:

  • [ ] Read the conflict markers:
<<<<<<< HEAD (current branch — "ours")
  current branch code
=======
  incoming branch code ("theirs")
>>>>>>> branch-name
  • [ ] Understand what ours changed and why
  • [ ] Understand what theirs changed and why
  • [ ] Check commit messages for context: git log --oneline -5 -- <file>

Step 3: Classify Conflict Type

TypeDescriptionResolution Strategy
TrivialSame file, different sectionsAccept both (auto-merge missed it)
AdditiveBoth sides added codeKeep both additions, order logically
CompetingBoth sides changed same lineUnderstand intent, pick correct version
StructuralFile renamed/moved vs editedKeep the rename, apply edits to new path
Delete vs EditOne side deleted, other editedDecide if deletion or edit is correct
SemanticNo textual conflict but logic conflictRequires understanding business logic

Step 4: Resolve Each File

  • [ ] For trivial/additive: combine both changes
  • [ ] For competing: choose the version that matches intended behavior, or merge logic from both
  • [ ] Remove ALL conflict markers (<<<<<<<, =======, >>>>>>>)
  • [ ] Verify the file is syntactically valid
  • [ ] Verify imports are correct (no duplicates, no missing)

Step 5: Validate Resolution

  • [ ] Run type-check: {{CONFIG.testing.typeCheckCommand}}
  • [ ] Run lint on resolved files (use read_lints tool)
  • [ ] Run tests for affected files only (not full suite)
  • [ ] Verify no conflict markers remain: search for <<<<<<< in resolved files

Step 6: Complete the Operation

For merge:

git add <resolved-files>
git commit  # Uses the pre-populated merge commit message

For rebase:

git add <resolved-files>
git rebase --continue

For cherry-pick:

git add <resolved-files>
git cherry-pick --continue

Step 7: Post-Resolution

  • [ ] Verify the merge/rebase completed: git status shows clean state
  • [ ] Run a broader validation if many files changed
  • [ ] Check git log --graph --oneline -10 to verify history looks correct

Abort Strategies

If resolution becomes too complex:

git merge --abort     # Undo a merge
git rebase --abort    # Undo a rebase
git cherry-pick --abort  # Undo a cherry-pick

Rules

  • ALWAYS understand both sides before resolving
  • ALWAYS validate after resolving (type-check, lint, tests)
  • NEVER blindly accept "ours" or "theirs" for all files
  • NEVER leave conflict markers in resolved files
  • NEVER resolve semantic conflicts without understanding the business logic
  • When in doubt, ask the user which behavior is correct
  • Prefer small, file-by-file resolution over bulk operations

Completion

All conflicts resolved, validated, and merge/rebase completed. Working tree is clean.

If a Step Fails

  • Can't understand intent: Check PR descriptions, commit messages, or ask the user
  • Type-check fails after resolve: Likely a missed import or incompatible types — fix before continuing
  • Tests fail after resolve: Logic conflict exists — review both changes more carefully
  • Too many conflicts (>20 files): Consider aborting and rebasing incrementally, or merging main into the feature branch first

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.