
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-resolverAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 27 |
| Last updated | April 25, 2026 |
| Repository | girijashankarj/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: 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 statusshows "Unmerged paths") - [ ] Understanding of the intended behavior of both branches
Steps
Step 1: Assess the Situation
- [ ] Run
git statusto 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
| Type | Description | Resolution Strategy |
|---|---|---|
| Trivial | Same file, different sections | Accept both (auto-merge missed it) |
| Additive | Both sides added code | Keep both additions, order logically |
| Competing | Both sides changed same line | Understand intent, pick correct version |
| Structural | File renamed/moved vs edited | Keep the rename, apply edits to new path |
| Delete vs Edit | One side deleted, other edited | Decide if deletion or edit is correct |
| Semantic | No textual conflict but logic conflict | Requires 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_lintstool) - [ ] 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 messageFor rebase:
git add <resolved-files>
git rebase --continueFor cherry-pick:
git add <resolved-files>
git cherry-pick --continueStep 7: Post-Resolution
- [ ] Verify the merge/rebase completed:
git statusshows clean state - [ ] Run a broader validation if many files changed
- [ ] Check
git log --graph --oneline -10to 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-pickRules
- 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