Git Merge Conflict Resolver

Open a file that git left with conflict markers, compare our side, their side and the common base for each hunk, take one side, keep both or write your own version, auto-resolve the safe hunks and save a file that is free of markers.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Open files

    Open one or more conflicted files, paste text into Edit source or add a sample.

  2. 2
    Auto-resolve

    Press Auto-resolve safe hunks to settle identical, one-sided and whitespace hunks.

  3. 3
    Compare sides

    Read ours, base and theirs side by side with the differing lines highlighted.

  4. 4
    Choose per hunk

    Pick ours, theirs, both, base or edit by hand; jump to the next unresolved hunk.

  5. 5
    Check the result

    Open the resolved file view and make sure no markers are left.

  6. 6
    Save

    Download the file, copy it or the report, then git add and continue the merge.

About this tool

When git cannot combine two changes to the same lines, it writes both versions into the file between conflict markers: a line of seven less-than signs with our branch name, our lines, a line of seven equals signs, their lines and a line of seven greater-than signs with their branch name. With merge.conflictStyle set to diff3 or zdiff3 there is a third section after a line of seven pipes, holding the common base the two sides started from. This resolver reads all three styles, any marker length git uses, Windows and Unix line endings, and several files at once. Each hunk is shown as cards side by side, ours in teal, base in grey and theirs in indigo, with the lines that differ highlighted. Every hunk is classified using the same reasoning a careful reviewer would apply. If both sides made the same change, either side is right. If a base is present and only one side changed, the changed side wins. If the sides differ only in whitespace, either side is safe. If both sides added lines at the same spot, keeping both is often correct, and if one side deleted a block the other edited, a person must decide. The auto-resolve button applies only the safe answers. For the rest you choose ours, theirs, both in either order, the base, or edit the block by hand in a text box pre-filled with both sides. Unresolved hunks keep their markers, so git still sees them as conflicts.

Finishing the merge

The resolved file view shows the assembled result and warns with line numbers if any marker line is left. The file keeps its original line endings and final newline, which avoids noisy whitespace diffs after the merge. Save the file under its own name, then run git add on it and git merge --continue, git rebase --continue or git cherry-pick --continue as your operation requires. The copy report button gives a short list of each hunk and the choice made, ready to paste into a commit message or a pull request description so reviewers know how the conflict was settled.

Worked example

Open the diff3 config sample, settings.ini. It has 3 hunks. In the first, lines 3 to 9, the base had port = 80, our side changed it to 8080 and their side left it alone, so it is classified as changed on our side only and auto-resolve keeps port = 8080. The second hunk, lines 10 to 16, is a real conflict: the base timeout was 10, ours is 30 and theirs 60. The third hunk, lines 19 to 24, has an empty base and two different additions, level = info and format = json, so the tool suggests keeping both. Auto-resolve settles 1 of 3 hunks. Choose ours for the timeout and Both, ours first for the log section, and the resolved file has no markers left, with port = 8080, timeout = 30, and both log settings under [log].

Limits

The tool works on the text of one file at a time and does not run git, so it cannot see the full history, rename detection or binary files. It does not check that the merged code compiles or that tests pass. Classification looks at lines, not program meaning, so always read the result before committing.

Worked example

settings.ini (diff3): 3 hunks, 1 auto-resolved (port = 8080), timeout and log section chosen by hand.

Quick facts

Frequently asked questions

What do ours and theirs mean?

During a merge, ours is the branch you are on and theirs is the branch being merged in. During a rebase they swap: ours is the branch you are rebasing onto and theirs is your commit being replayed, so read the labels on the markers.

How do I get the base section?

Run git config merge.conflictStyle diff3, or zdiff3 on git 2.35 and later, before merging. Git then writes the common ancestor between ||||||| and =======, and this tool can auto-resolve hunks where only one side changed.

Is auto-resolve safe?

It only acts when the answer is clear from the text: identical sides, one side unchanged from the base, or whitespace-only differences if you allow them. Real conflicts, both-side additions and delete-versus-edit cases always wait for your choice.

Can I edit a hunk freely?

Yes. Choose Edit by hand and a text box opens with both sides combined. Write the lines you want; they replace the whole hunk. You can also edit the full source in the Edit source tab.

Does it handle Windows line endings?

Yes. CRLF files are detected and saved with CRLF, and a missing final newline stays missing, so the saved file differs from the original only where you resolved conflicts.

Is my code uploaded?

No. Files are read and assembled inside this page and saved only in this browser's local storage, with undo and redo for every choice.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages