What's the best three-way merge tool?
Version ControlMergeDvcsVersion Control Problem Overview
Subversion, Git, Mercurial and others support three-way merges (combining mine, theirs, and the "base" revision) and support graphical tools to resolve conflicts.
What tool do you use? Windows, Mac OS X, Linux, free or commercial, you name it.
Here's a few that I've used or heard of, just to get the conversation started:
(I recognize that this is sort of like the [Best Diff Tool][5], but it's different in that I explicitly focus on three-way merge tools; [WinMerge][6] is off the list, for example.)
[5]: https://stackoverflow.com/questions/12625/best-diff-tool "Best Diff Tool" [6]: http://en.wikipedia.org/wiki/WinMerge
Version Control Solutions
Solution 1 - Version Control
KDiff3 open source, cross platform
Same interface for Linux and Windows, very smart algorithm for solving conflicts, regular expressions for automatically solving conflicts, integrate with ClearCase, SVN, Git, MS Visual Studio, editable merged file, compare directories
Its keyboard-navigation is great: ctrl-arrows to navigate the diffs, ctrl-1, 2, 3 to do the merging.
Solution 2 - Version Control
Just checked out P4merge since I heard about it in another blog article:
Very slick interface, and FREE! I've been a faithful Araxis Merge user, but considering this is free and awesome, I'd encourage you to check it out.
Solution 3 - Version Control
Beyond Compare 3 Pro supports three-way merging, and it is a pretty impressive merge tool. It's commercial (but worth it, IMHO) and is available on Windows, Linux, and Mac OS X.
As pointed out in a comment, it's also inexpensive.
Note: If one does not have a merge set, that is, merge markers resident in the destination file, Beyond Compare does not offer three-way file compare/editing. Beyond Compare says that feature is on their list.
Note: 3-way merge is a feature in the Pro edition of Beyond Compare 3 only
Solution 4 - Version Control
I have had only good experiences working with Meld. I use it when I have to do messy code merges between branches. It is simple to use and has a clean interface.
- Open Source
- Linux, Windows and MacOS Supported
- Multiple File Diff
- Three-way Compare Support
In Ubuntu, install is as simple as: sudo apt-get install meld
Solution 5 - Version Control
vimdiff. It's great. All you need is a window three feet wide.
Solution 6 - Version Control
Cross-platform, true three-way merges and it's completely free for commercial or personal usage.
Solution 7 - Version Control
Araxis Merge. It is commerical, but it is so worth it... It is available for Windows and the Mac OS X.
Solution 8 - Version Control
Kdiff3 conflict resolution algorithm is really impressive.
Even when subversion indicates a conflict, Kdiff3 solves it automatically. There's versions for Windows and Linux with the same interface. It is possible to integrate it with Tortoise and with your linux shell.
It is in the list of my favorite open source software. One of the first tools I install in any machine.
You can configure it as the default diff tool in Subversion, Git, Mercurial, and ClearCase. It also solves almost all the ClearCase conflicts. In Windows, it has a nice integration with windows explorer: select two files and right click to compare them, or right click to 'save to later' a file, and then select another one to compare.
The merged file is editable. Has slick keyboard shortcuts.
You can also use it compare and merge directories. See:
An advanced feature is to use regular expressions for defining automatic merges.
My only annoyance is that it is a little difficult to compile if it isn't present in your favorite distro repository.
Solution 9 - Version Control
I love Ediff. It comes built-in with GNU Emacs.
To do a three-way diff, use ediff-files3
(for selecting three files) or ediff-buffer3
(for selecting three already-open buffers). You'll get a screen looking like this:
Note the word-difference higlighting.
You can hit n
or p
to go to the next/previous diffs, while ab
will copy the region from buffer a (the leftmost one) to buffer b (the middle one), and similarly for other two-letter combinations of a
, b
, c
; rb
will restore the region in buffer b. Hit ?
for a quick help menu, or read the fine manual on diff3 merging in Emacs.
Solution 10 - Version Control
Ultracompare. It is really good, handles large files (more than 1 GB) well, is available for Windows/Mac/Linux, and it's commercial, but it is worth it.
Solution 11 - Version Control
Diffuse is an easy to use three-way merge tool. It supports all of the platforms and version control systems you mentioned, and it can compare more than three files at the same time.
Solution 12 - Version Control
xxdiff if you're in Linux land.
Solution 13 - Version Control
The summary is that I found ECMerge to be a great, though commercial product. http://www.elliecomputing.com/products/merge_overview.asp
I also agree with MrTelly that Ultracompare is very good. One nice feature is that it will compare RTF and Word docs, which is handy when you end up programming in word with the sales guys and they don't manage their docs correctly.