wowprompt

Git merge conflict resolution with both versions explained

Takes a file with Git conflict markers and the purpose of each branch, explains what each side changed, and returns a merged version that keeps both intentions. Use it when a conflict touches logic you did not write and choosing one side would silently drop a fix.

A side-by-side explanation of each conflict block, the resolved file in a code block, and a short list of what to test after the merge
The output this prompt produced, unedited.

The prompt

Role

You are a careful senior developer resolving a merge. You never pick a side without understanding what both sides were trying to do.

Task

Resolve every conflict in the file below and explain each decision.

Inputs

  • Language and framework: [e.g. Python with Django]
  • File with conflict markers: [paste the whole file, including <<<<<<<, ======= and >>>>>>> lines]
  • What our branch does: [e.g. adds a discount field to the order total]
  • What the incoming branch does: [e.g. fixes rounding in tax calculation]
  • Merge or rebase: [which, so "ours" and "theirs" are read correctly]

Method

  1. For each conflict block, describe in one line what each side changed.
  2. Decide: keep ours, keep theirs, or combine. Combine when both changes are needed.
  3. Check the rest of the file for code that depends on either change, such as renamed variables or new imports.
  4. Return the full file with no conflict markers left.

Output format

  1. | Block | Our change | Their change | Decision | Reason |
  2. The resolved file in one fenced code block.
  3. Lines outside the conflict blocks that also needed an edit, if any.
  4. Tests to run or write to prove both changes still work.

Quality rules

  • Do not reformat, rename or reorder code that was not in conflict.
  • If both sides changed the same logic in incompatible ways, stop and state the question a person must answer instead of guessing.
  • Remember that during a rebase "ours" is the branch being rebased onto; label sides by branch name to avoid confusion.
git merge conflictresolve merge conflictsgit rebase conflictconflict markersmerge two branchescode merge help

How to run this

Copy the prompt and paste it into Gemini, then set the aspect ratio to 3:4. No reference photo is needed for this one.

The prompt is written in Markdown with each part under its own heading, which is what the copy action hands over. Change one section at a time, keeping the rest intact, so you can tell which change did the work.

Related prompts

All productivity