Community

Mac OS X Diff and Patch: FileMerge and Terminal

Last updated October 14, 2009.

FileMerge is a great utility for diff comparisons in the Mac OS X environment. It has a great graphic user interface and is simple to use without learning complicated Terminal command lines. The GUI provides a traditional left and right side comparison layout, and the ability to manually review and save changes. It is possibly the only free diff UI available for Mac OS X developers.

This utility comes free bundled with Xcode, a free development tools package offered with any Mac OS X operating system or by a free subscription to the Apple developer site.

FileMerge is only 700k in size but a full install of Apple's Xcode asks for 3.4 GB of disk space! In order to get the application installed and use the minimum amount of storage space, run the Xcode custom installer and select only the "Developer Tools Software". This will provide you with the application you want and only 180 MB of disk usage.

There is an installation walkthrough provided here.

Oreillynet.com has a great tutorial to help you get started using the application for diff functions.

For patch utilities, there is no simple or free GUI yet for us Mac users. You must still use the Mac utility called Terminal to apply patches via command line. For the fast answer to how to patch on Mac OS X, open Terminal and navigate to the directory which holds your original and patch files, and use this sample command string:

$ patch < example.patch

This is neatly described in the Drupal Handbooks in much more detail: http://drupal.org/patch/create

Further GUI diff tools are listed here: http://stackoverflow.com/questions/187064/graphical-diff-for-mac-os-x

Comments

Small org suggestion

I think the first part of this page should be put under the section on creating patches. And the last little part doesn't add anything that the parent page doesn't cover better (about using the command line version of patch) so should just be dropped.

--Ryan
www.ryancross.com
www.jamescrossinc.com

well

It doesn't add anything except aggregate the answers to many a Mac user question all on the same page. Its disorienting to wade through search results looking for answers in your own OS frame or reference. If this page were edited then I would like to see more Mac specific instructions for operating the patch command - and maybe included in a Mac-specific Drupal development section.