When I was searching for a good file comparison editor to use with Git, I was shocked to find 46 different editors available. Which one do you use?
To separate these 46 editors I came up with a list of criteria I wanted.
- The editor had to run on Windows, Linux, and the Mac, and look the same. No matter what platform I used, I did not want to relearn a new merge tool, and I wanted it to be the same so there was no slow down in my work. This criteria alone cut the list down to 20 editors.
- Since there were so many editors out there, and there was not that much difference in their functionality, I decided I wanted a free or open source editor. This cut the list down to 14 editors.
- I wanted an editor that handled both difference in two files, and merging three files in one editor. We're down to five editors: kdiff3, Sourcegear's diffmerge, Perforce's P4Merge, vimdiff, and xxdiff. A quick way to separate these five is to go to Google Images and search for the above editor's name to see a screen shot of the editor.
- I wanted a modern looking editor that didn't look like it was made to run in Dos. We're down to three: kdiff3, Sourcegear diffmerge, and Perforce PP4Merge with kdiff3 being borderline.
- And finally I wanted lines running between the two files comparing the differences, as opposed to bars running vertically along the side of the page. This is a personal preference, but it seems like an easier way to work for me. This left one: Perforce P4Merge.
P4Merge comes as a free utility with the Perforce Client. Perforce makes version control software for large organizations with a client server set up, where you load the client on each user's computer. Because of this, and to be fair, P4Merge does not have some features, that if your looking for, you should try another editor. P4Merge does not handle version control browsing, binary comparison, directory comparison, syntax highlighting, or reports. What it does handle well is resolving file differences.
P4Merge comes bundled as a separate utility with Perforce's commercial version control software client. To get it, go here, and click on your platform under "The Perforce Client (P4V)." You will download a 22Mb file that contains several pieces of software, click on the .exe to to start the install. When it asks you to select application packages, select P4Merge and the command line tool. You do not need the Client or SCC plugin. P4Merge will install and your all set.
Here's some screen shots of the editor with two files and three files. On the merge tool with the three files shown below, notice the tree with icons in the upper left showing you exactly how you are merging. I haven't seen another editor with this feature. Each window is color and icon coded so you know exactly which is the base, local, and remote version. You edit in the lower window and you can switch which version you edit by clicking on the icons on the right. Notice also that the lines run across the screen showing you where the edits need to be resolved.
Once you edit your changes, and save the resulting merge file, you'll want commit your changes in your version control software, now that you've resolved your conflicts. The results should be that there will no longer be any conflicts when you do your commit.
Overall, P4Merge is an exceptionally nice merge tool. It is easy to use, nice looking, and works well with Git, my version control software. If you'd like to configure it with Git, please see my article on: "Installing Perforce's P4Merge in Git for Windows."
I have to give Perforce's P4Merge a 5-star rating, and thank Perforce for making such a nice file comparison tool available to the community.