AddThis Social Bookmark Button


Xcode for the Rest of Us, Part II
Pages: 1, 2, 3

Using FileMerge

If you installed the developer tools, you will find FileMerge here:

figure 5

Figure 5. FileMerge location in hierarchy

Let's get started. Double-click on FileMerge and here is what you see:

figure 6

Figure 6. FileMerge interface

I took most of the text you are reading now, copied it to another text file and made a few small changes ("diff" to "spiff," "command line" to "Terminal," et. al).

figure 7

Figure 7. My original files

Here is the way you can use FileMerge quickly. Simple drag one file from the Finder to the left well:

figure 8

Figure 8. Drag and drop your original file from the Finder

Then, drag and drop your other file from the Finder to the right well, and click the Compare button. Here is what you will see:

figure 9

Figure 9. What you see in the compare window

First, you see the file you dragged to the left well on the left-hand upper portion of the screen, and the file you dragged to the right well on the right-hand side of the screen. The blue highlighting with the grey swish shows you where the differences are between the two files. Wow, we certainly have a few differences between the two files. Imagine spending all night with Find/Replace from the File menu--no way!

When I choose the first diffed line, the Actions drop-down menu is activated:

figure 10

Figure 10. The action drop-down menu in action

You can choose to move data from left to right, right to left, choose both (left or right first) or, my favorite, choose neither. You can see the differences you want to keep, and those you want to toss. I am going to choose an amalgam of both, and save the merged files as the new MDCII_FileMergeBogus.txt:

figure 11

Figure 11. Saving the merged files

Now I want to re-compare the merged files. How to do this? Simple: go up to the File menu and choose Recompare Files. Here is what I get:

figure 12

Figure 12. Re-comparing merged files

Way too tedious. Why not hold down your Shift key and highlight everything?

figure 13

Figure 13. All differences highlighted

You can then save the merged file.

Pages: 1, 2, 3

Next Pagearrow