Documentation

3-way merge

DiffScope merges your version and theirs against the common base. Changes that do not overlap are merged for you. You choose how each conflict is resolved, edit the result if you need to, and save.

Applies to DiffScope v1.5.2 Updated Oct 2026

The workflow at a glance

  1. Open the merge from the home screen, or from a script or another tool with /base: /mine: /theirs: /merged: on the command line.
  2. DiffScope merges every non-overlapping change and selects the first conflict.
  3. For each conflict, pick Mine, Theirs, a combination or Base. Press F8 to move to the next one.
  4. Edit the output by hand if neither side is quite right.
  5. Save with Ctrl+S and close the window. The exit code tells the calling tool whether the merge is resolved.

The four panes

DiffScope 3-way merge: Mine, Base and Theirs panes on top, the editable Output pane below with a conflict bar DiffScope 3-way merge in the light theme
Mine, Base and Theirs on top, the Output below.
Mine
Your version. Read-only.
Base
The common ancestor both versions started from. Read-only.
Theirs
The incoming version. Read-only.
Output
The merge result, and the only pane you can edit. Its header shows the file it will be saved to, the encoding and line endings it will be written with, and how many conflicts are still unresolved.

All four panes scroll together. Drag the bar above the output to resize. The overview strip marks every change and conflict; click it to jump.

Colours show where each change came from: changes made only in mine, only in theirs, or the same change made on both sides. Conflicts are marked in red until you resolve them. In a resolved conflict, the side you took is highlighted and the side you dropped is dimmed.

Auto-merge

When the merge opens, DiffScope has already applied every change that does not overlap a change on the other side, and every change both sides made the same way. The status bar shows how many, for example 4 changes merged automatically. If nothing conflicts, you only need to review and save.

The whitespace and case options (-w, -b, -i) also apply to merges, so changes that differ only in whitespace or case can be merged without a conflict. See the command-line reference.

Resolving conflicts

An unresolved conflict shows a placeholder line in the output: ⚠ unresolved conflict — choose Mine, Theirs, Base or a combination. A bar above it holds the choices for that conflict. You can resolve the current conflict in several ways:

ChoiceOutput getsKey
MineYour linesAlt+1
TheirsTheir linesAlt+2
Mine + TheirsYour lines, then theirsAlt+3
Theirs + MineTheir lines, then yoursAlt+4
BaseThe original lines (drops both changes)Alt+5
UnresolveBack to an unresolved conflictAlt+0
  • Use the toolbar buttons, the keys above, or the buttons in the conflict's bar in the output pane.
  • Double-click a conflict in the Mine or Theirs pane to take that side.
  • Merge › Use … for All Remaining, or Shift+click a toolbar button, applies that choice to every remaining unresolved conflict.
  • You can change your mind: pick another choice for a resolved conflict, or unresolve it.

F8 moves to the next conflict and Shift+F8 to the previous one (F7 / Shift+F7 work too). Unresolved conflicts come first; when none are left, the keys step through the resolved ones. The toolbar counter shows how many are left, for example 2 of 5 conflicts left. Turn on Merge › Advance After Resolving to move to the next conflict after each choice.

Merge › Take Whole File resolves every chunk with one side at once, and Compare Result opens the current output against base, mine or theirs in a new tab.

Picking lines

When neither side is right on its own, build the result from single lines. Inside a conflict, click a line number in the Mine, Theirs or Base pane (or put the caret on the line and press Ctrl+Alt+Enter) to add that line to the output; click again to take it out. Lines go into the output in the order you pick them, and Merge › Pick Lines › Sort Picked Lines puts them back in file order. The Mine, Theirs and Base check buttons in the conflict bar include a whole side the same way.

Automatic resolution

  • The magic wand (Ctrl+Alt+M, or Merge › Resolve Automatically) resolves a conflict where the two sides changed different words of the same lines. Resolve All Simple Conflicts does every such conflict. Strict safety rules apply, and the result is one undo step.
  • Resolve Whitespace-Only Conflicts settles conflicts whose sides differ only in whitespace; a setting can do it whenever a merge opens.
  • The whitespace and case options of the toolbar also apply to the merge itself, so changes that differ only in whitespace or case merge without a conflict. Alt+F8 goes to the next change they hid.

Editing the output

The output is a full code editor, like the panes of the text compare: click and type, with find and replace (Ctrl+F) and go to line (Ctrl+G). A conflict has to be resolved before you can edit its lines; pick the closest choice first, then adjust it. Edited conflicts are labelled (edited). Mine, Base and Theirs are read-only, unless you turn on the Editable mine / theirs panes setting.

Ctrl+Z and Ctrl+Y undo and redo both resolutions and edits.

Saving the result

Ctrl+S writes the output to the merged file. If the merge was started without an output file, DiffScope asks where to save it.

  • Encoding and BOM are taken from mine.
  • Line endings follow the main line ending of mine (then theirs, then base). Whether the file ends with a newline also follows mine.

Saving with unresolved conflicts

If conflicts are left, DiffScope warns you and offers Save with Markers. Each unresolved conflict is then written with conflict markers, and the merge counts as unresolved when you close the window:

<<<<<<< mine
your lines
=======
their lines
>>>>>>> theirs

The labels after the markers are the pane titles (for example from /minename:), or mine and theirs when there are none.

diff3 style

Start the merge with --diff3 to include the base version in each conflict:

<<<<<<< mine
your lines
||||||| base
the original lines
=======
their lines
>>>>>>> theirs

Closing and exit codes

A merge started from the command line or by another program sets the process exit code when its tab closes: 0 when saved with no conflicts left, 1 otherwise, so calling tools and scripts know the result. File › Mark as Resolved saves the merge, checks the file on disk, marks it resolved in your version-control working copy and closes the tab.

CodeWhen
0The output was saved with no conflicts left.
1Anything else: closed without saving, saved with conflict markers, or the merge could not be opened.

If you close a merge that is not saved, or still has conflicts, DiffScope asks: Save and Close, Close without Saving or Cancel. If you already saved a clean result and then made more edits, closing without saving keeps the clean file on disk, and the exit code is still 0.

Merging without a window is covered in headless mode: it writes the result with markers and returns 0 for a clean merge, 1 when conflicts are left, and 2 on errors. /automerge merges without a window too, and /reviewconflicts opens the window only when conflicts remain.

If DiffScope closes unexpectedly while a merge has unsaved work, Home offers to recover it the next time you start.

Limits

  • All three inputs must be text files. Binary files cannot be merged; three folders open a 3-way folder merge, where each file is merged on its own.
  • The output folder must already exist.