resolving-merge-conflicts

Resolves in-progress git merge and rebase conflicts while preserving both change intents.

Updated May 9, 2024
One-click install
npx skills add https://github.com/AceCodePt/dotfiles --skill resolving-merge-conflicts-acecodept
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: resolving-merge-conflicts
Source: https://github.com/AceCodePt/dotfiles/tree/main/.config/opencode/skills/resolving-merge-conflicts
Command: npx skills add https://github.com/AceCodePt/dotfiles --skill resolving-merge-conflicts-acecodept

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Merge and rebase conflicts interrupt development and are often resolved hastily, losing the intent of one side's changes or introducing broken code. This Skill provides a disciplined workflow for understanding each conflict's origin, resolving hunks correctly, and verifying the result with the project's automated checks. ## Core Features & Use Cases - Conflict Investigation: Inspects the current merge/rebase state, git history, commit messages, PRs, and linked issues to understand why each change was made. - Intent-Preserving Resolution: Resolves each conflicting hunk by preserving both intents where possible, choosing the side matching the merge's stated goal when they are incompatible, and never aborting the merge. - Verification and Completion: Runs the project's typecheck, tests, and formatting checks, fixes anything the merge broke, then stages, commits, and continues the rebase until finished. - Use Case: You run git rebase main on a long-lived feature branch and hit conflicts across several files. The Skill traces each conflicting change back to its commit and PR, resolves the hunks without dropping either feature's behavior, runs the test suite, and completes the rebase. ## Quick Start Resolve the current git merge conflict in this repository, verify the project checks pass, and finish the merge.

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 changes?▼

Resolve git merge conflicts by first understanding why each side changed the code: read the commit messages, PRs, and linked issues. Then resolve each hunk to preserve both intents where possible, and run the project's tests to confirm nothing broke.

How to resolve conflicts during a git rebase?▼

During a rebase, resolve each conflicting hunk in the affected files, stage the results, and continue the rebase until all commits are replayed. Investigate the original commits to understand intent before choosing how to combine the changes.

Should I use git merge or git rebase for conflicting branches?▼

Both merge and rebase can produce conflicts, and the resolution approach is the same: understand each change's intent and preserve it. Rebase replays commits one at a time, so conflicts may appear in multiple stages, while merge presents them all at once.

What should I do after resolving a merge conflict?▼

After resolving conflicts, run the project's automated checks, typically typecheck, then tests, then formatting, and fix anything the merge broke. Then stage all resolved files and commit, or continue the rebase until it completes.

When should I abort a merge instead of resolving conflicts?▼

This workflow never aborts: it always resolves conflicts by tracing each change to its source and picking the resolution matching the merge's stated goal. Aborting discards progress and leaves the underlying divergence unaddressed.