Skip to content

Three-way merge editor

When a merge, a pull or a rebase cannot reconcile two versions of a file on its own, Git Manager opens that file in a three-way editor instead of leaving conflict markers in your working copy for you to untangle by hand. The two versions sit on either side, the result you are building is in the middle, and each side is labelled with where it comes from — worth reading, because which one counts as "yours" flips between a merge and a rebase.

Resolve a conflicted file block by block

Clicking a conflicted file in the graph's conflict panel opens it here, in its own window. A conflicted file is rarely conflicted everywhere — most of it is changes only one side made, which have exactly one sensible outcome, and "Apply non-conflicting changes" takes all of those in one click. What is left is the blocks where both sides really did edit the same lines: for each of those you pick a side from the gap between the panes, or type the answer yourself in the middle pane when neither version is quite right. The apply button stays disabled until every block has an outcome, so you cannot accidentally write a half-resolved file; applying it writes the merged result to disk and stages it, which is what tells Git the conflict is settled.

Resolve a conflicted file block by block

Captured from the running app by this scenario.

Do this

  1. Open the merge editor for dependency-manifest.txt

You should see

  • The merge editor is shown
  • The merge editor offers to auto-merge the non-conflicting blocks

Filtering the diff by whitespace, highlight mode, and unfolding everything

The same toolbar that resolves conflicts also decides how the diff itself reads. "Do not ignore" is the default; pointing it at "Ignore whitespace" hides changes that are only reindentation, so what's left is what actually changed. The highlight mode chooses whether an edit is marked word by word or by the whole line it sits on. Unchanged fragments between blocks are collapsed away from the moment the editor opens — one click on the fold icon gets the whole file back, for the times a change only makes sense next to what didn't change.

Filtering the diff by whitespace, highlight mode, and unfolding everything

Captured from the running app by this scenario.

Do this

  1. Open the merge editor for dependency-manifest.txt
  2. Turn off collapsing unchanged regions
  3. Set the whitespace mode to Ignore whitespace
  4. Set the highlight mode to Highlight lines
  5. Click the recalculate-diff button

You should see

  • The whitespace mode is Do not ignore
  • The highlight mode is Highlight words
  • Unchanged regions are collapsed
  • Unchanged regions are not collapsed
  • The whitespace mode is Ignore whitespace
  • The highlight mode is Highlight lines
  • The merge editor is shown
  • No error notification is displayed

Auto-merging then resolving the remaining conflicts writes the merged result to disk

"Apply non-conflicting changes" is the wand icon in the toolbar: one click resolves every block where only one side actually changed something, which on a real conflicted file is most of it. What survives is the handful of blocks both sides genuinely touched — pick a side from each remaining gap the same way as always, and the apply button enables the moment none are left undecided.

Auto-merging then resolving the remaining conflicts writes the merged result to disk

Captured from the running app by this scenario.

Do this

  1. Click the conflicted file dependency-manifest.txt to resolve it
  2. Click the merge editor auto-merge wand
  3. Accept the right side for every remaining conflicting block
  4. Click the merge editor apply button

You should see

  • The merge apply button is enabled
  • The file dependency-manifest.txt is staged and no longer conflicted
  • The file dependency-manifest.txt contains the line http-client = 7.32.0
  • The file dependency-manifest.txt contains the line json-parser = 2.9.0
  • The file dependency-manifest.txt contains the line database-driver = 5.1.0
  • The file dependency-manifest.txt contains the line auth-provider = 2.1.0
  • The file dependency-manifest.txt contains the line addon-metrics = 1.0.0
  • The file dependency-manifest.txt does not contain the line legacy-cache = 0.3.0
  • The file dependency-manifest.txt contains the line deprecated-auth = 0.2.0
  • The file dependency-manifest.txt does not contain the line theirs-metrics = 1.0.0

This page is generated from apps/e2e/features/merge-editor.feature, the end-to-end test that drives the feature it describes.

MIT licensed · Screenshots exported from the real app by the end-to-end suite.