There is an official piece of Apple software that will do this. It's called FileMerge. But the catch is that it doesn't come with Mac OS 10. Instead in comes with XCode, which is the developer environment. In order to get the XCode, you have to join the Apple developer community, which is free, and then you have to go over to this part of the Apple site and download XCode, which is a whole gig. Once you've got it, though, you've got a bunch of useful utilities, including FileMerge.
With FileMerge, you get two areas you can compare, left and right. You select what you want for the left comparison, and then you select what you want for the right comparison. Then hit ""compare."" What you'll get is a comparison of everything in those folders. So you get here that Test File 2 is different, 3 is on the left, and 4 is on the right. You can narrow down your results if you have a long list, for instance excluding anything that's identical. Then you select all the files if you want to do a merge. You select what kind of merge, Combine Files, Use left as predominant, right as predominant, etc. Once you've selected the type of merge that you want to do, you select it. It'll ask you what you want to do -- use the existing directory or create a new one. Let's create a new directory at the Test level. We'll call it Test3, and we'll save. The important thing was that I selected all the files on the left. If I had only selected some, it would only have merged those. It's important to remember to do that extra step. Now we look in the Test directory and see that there is, indeed, Test 3, and we see that all the different files are there, including the updated version of Test File 2. And we see the rest, merged together in that one directory. So using FileMerge is pretty difficult if you're not used to programming. There are a lot of different options, and it doesn't always work completely as you'd expect, so it takes some time getting used to. It's not a very automated solution, either.
Now let's look at how we can use the terminal to merge two folders together. We're going to use a command called ""ditto."" This will merge two folders together, and it's pretty easy to use. The first thing you want to do is navigate in terminal to the current directory. Test1 and Test2 are in a directory called ""Test."" An easy way to get there without figuring out exactly where that is, is to select it, and copy. Then we go over to the terminal, and we type ""cd"" for change directory, and then we paste the full path in there. Now we are in that test directory. If we do ""ls"" for list, we look and see, there's Test1 and Test2. Now we're ready to go. What ditto will do is merge two or more directories together, and put them in a third, if you like. For instance, let's do Test1 and Test2, and put them in Test3. And instantly we see that, not only did the command complete in the terminal window, but it created that folder. If we look at Test3, we can see all five files in there. Now let's go and take a look. Of course, 3 and 4 are one from each of the directories, and 2 is actually updated today. And you could see that that's the current file, if we looked into it, rather than the old file. Now if we delete Test3 and reverse the ditto command, we'll see something different as a result. Test2 Test1 Test3. We get the five files just as before, but if we look at File 2, we see that it's the old one. So what ditto is doing is saying, grab the first folder, and then grab the second folder, and this is the one that supersedes the first one. When we do the opposite, Test1 supersedes the second one, so we end up with the old file. This isn't as useful as determining which ones are exactly the newest, but at least you do have this sort of control over it. You can also merge two folders into one, by simply only having two directories there. For instance, ""ditto Test1 Test2"" will merge the contents and the results will be in Test2. You can also merge a whole bunch of them, and the last one will always be the folder that everything ends up in. If it exists, then the contents of that are also merged. If it doesn't exist, it creates it and puts the merge in that folder.
Now there are a bunch of shareware programs out there that allow you to synchronize and merge folders. They have various prices and they have various features. For just simply merging some together, though, one of the simplest seems to be one called File Synchronization. You can download it here. What File Synchronization does is, it allows you to add a pair of folders, and you can do that by dragging and dropping. We can add Test1 and Test2 like that. And then you can determine what you want to do. You can add all sorts of different options, what to do with orphan files, you can set up automatic synchronization between the two of them, and you can set lots of different preferences. Click the synchronize button, and it will synchronize the two folders. This isn't simply merging two folders into one. This is actually synchronizing both. So if I go back to Test1 and Test2, I find they both have all the files in there now. In addition to that, I find that Test File 2 is now the most recent one in both folders. So it's a true file folder synchronization program, not just a merge. It's worth taking a look at, and it costs about $15. There are a lot of other ones there, that cost anywhere between that and upwards of $30 or even more, that do even more advanced file synchronization.
So there's a look at three different ways that you can merge folders together on Mac. They all fall far short of the Windows way of doing it, which is just so simple and elegant that it becomes way more useful. Hopefully, in future versions of Mac OS 10, we'll get the option to either supersedes do it the old way, by replacing a folder, or doing a merge similar to that used in Windows. Until next time, this is Gary Rosenzweig with MacMost Now.
Show notes: The link to download XCode is http://developer.apple.com/tools/xcode/. You can read all about the Terminal ditto command at this official help page: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/ditto.1.html. You can get File Synchronization here: http://nemesys2.dyndns.org:8080/.