Search This Blog

Wednesday 17 March 2010

Mac: Compare or merge two folders' contents

From here - http://www.macworld.com/article/49584/2006/03/cmpfldr.html

FileMerge in /Developer -> Applications -> Utilities

Launch it, then drag one folder into each drop zone in the Compare Files window.

Once you’ve added the folders, just click Compare. FileMerge opens a new window with a list of gray and black filenames. A gray filename indicates that the file is common to both folders. A black filename indicates that the file is unique to one folder. Select a file to see a status message at the bottom of the window. If this says “added to right,” that means the file is only in the folder you placed in the rightmost well. If the message says “added to left,” the opposite is true. To simplify this view, use the Exclude checkboxes. Select the Identical option, for example, if you don’t want to see files that exist in both folders.

If you’d like to look at any of the files, click the View button to display a drop-down menu of options. Choose Comparison (for text files only) to open the traditional FileMerge comparison window, or use the Left File and Right File options to see the actual text or images in the specified folder. The Ancestor and Merge views only apply to people using FileMerge to check code. Read more about these options in FileMerge’s Help file.

If all you wanted to do was to visually compare the two folders’ contents, you’re done. But you can also use FileMerge to actually merge the two folders together into one new one. To do this, select all the files in the leftmost column (click on one and then hit Command-A to select all). Then select Combine Files from the Merge pop-up menu (or press Command-1). FileMerge will ask you for a new directory name, and then proceed to merge the two directories into a new one. Any files that weren’t common to both folders will be added to the new folder, along with all of the identical files.