How do you do a 3-way merge in FileMerge?

Mark E. Haase picture Mark E. Haase · Jul 22, 2010 · Viewed 8k times · Source

I see the option for specifying three files (left, right, and ancestor), but it doesn't seem to be possible to actually display the ancestor.

enter image description here

The bottom pane shows the result of the merge. I'd rather see what the original content was, so I could understand the context for the left and right sides of the conflict. Is this possible? FileMerge has awful help documentation.

Answer

Mark E. Haase picture Mark E. Haase · Aug 18, 2011

Looks like in version 2.5 they have finally added this feature. "Ancestor" now actually means "Ancestor" and there is a separate "merge" option

From the command line you can do something like this:

$ opendiff mine theirs --ancestor base

Where "mine" is my version of the file, "theirs" is the version I'm trying to merge with, and "base" is the common ancestor of "mine" and "theirs.

This command will open File Merge and show the ancestor at the bottom (where the merge is in my example from 2010).

Unfortunately, it's not possible to use the --merge option along with the --ancestor option. So you can't view a three-way merge AND use File Merge to resolve the conflicts at the same time.

I am starting to use File Merge for viewing and understanding the conflict, then editing the conflict markers in a text editor as usual. (sigh...)