Best way of finding differences (diff) between two files on Mac OS X

Hello readers,

I wanted to share with you a great tool available on the Mac for reviewing code differences. If you have ever used the terminal in Mac or Linux, the most straight forward to view code differences is to use ‘diff’:

diff file1 file2

Screen Shot 2018-01-31 at 7.06.43 PM.png

The problem with this approach is that it is not easy to discern what the actual differences are from the output if the file is large, and there are many differences.

It is much easier to use ‘opendiff’:

opendiff file1 file2

Which will give you a very nice graphical visualization of the differences:

Screen Shot 2018-01-31 at 7.44.21 PM.png

Taken from here.

However, sometimes opendiff fails. In that case, I recommend paying for Beyond Compare, which is really the best diff software I encountered so far.

Advertisements