Compare Two Files with FileMerge in Mac OS X

Mar 4, 2010 - 11 Comments

Xcode_icon FileMerge lets you select any two files and it will compare the two, pointing out any differences between the files. If you’re a developer you already know why this is wildly useful, as it makes tracking down major and minor code changes remarkably easy. Apparently FileMerge is a survivor from the days of NeXTStep, and once you see how useful it is, you’ll see why it was saved and bundled with XCode. If you’re a developer and you haven’t found out about FileMerge yet, you are missing out on one of the more useful apps included within Apple’s XCode installation.

This tutorial will show you how to compare two files with FileMerge in Mac OS.


First things first: To get FileMerge for free, you’ll need Xcode, which can be installed from the App Store, one of the disks included with your Mac (if yours came with one), or downloaded for free from the Apple Developer site.

Once XCode has been installed, FileMerge will be located at /Developer/Applications/Utilities/FileMerge at the root of your Mac OS X installation.

Now that Xcode and Filemerge have been installed on the Mac, you’re ready to compare two files.

Just launch the FileMerge application, select your two files to compare (and merge, if you want to do that), and see how awesome it works.

FileMerge file comparison mac

Of course, this is intended for more advanced comparisons and merging and aimed primarily at developers comparing code versions. More average use for comparing say, two generic text documents, can be done with FileMerge as well, but an easier option that is more friendly to most users would be to use an app like Microsoft Word to compare two DOC text files.

The above FileMerge screenshot comes from Schwehr.org.

Do you know of any other useful ways to compare files? Have any other handy FileMerge tips? Share them below!

.

Related articles:

Posted by: Bill Ellis in Development, Mac OS, Tips & Tricks, Utilities

11 Comments

» Comments RSS Feed

  1. Pawel says:

    This also works for comparing directories – this is what I was looking for ages, excellent!

  2. SaulDan says:

    Hello,
    I received my new MacBook Air yesterday with Mac OS X 10.7.4, and then installed Xcode 4.4. The version of FileMerge that comes with it is giving me problems with saving a file after a merge: if I have merged two files and want to save the result, then FileMerge gives me an error message “Unable to save to file..”. Have other people experienced this? I tried downloading Kdiff3 and using that, but I have the same problem with Kdiff3 too, it tells me “error while writing” when I try to “save as”. Thank you for any help.

    • Elam says:

      Yeah, I have that problem, although I don’t get an error message. The merge is just never saved.

      It doesn’t matter if I try and save over an existing file or save the merge to a brand new file.

      Annoying.

  3. phoenix says:

    DiffMerge is available for Mac OSX, Windows, Linux, and is a fabulous tool. Much better than some FileMerge that’s hidden in a whole bunch of other stuff I don’t need (xcode).

    http://www.sourcegear.com/diffmerge/downloads.php

  4. […] you’re looking for a more developer orientated version of file comparison, check out […]

  5. CaptSaltyJack says:

    DiffMerge (by SourceGear) is way better. Just sayin’.

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site