Merging two folders can seem difficult or impossible until you learn this trick. While it is easy to drag and drop new files into an existing folder, you'll need to decide which ones to keep and which to replace on a file-by-file basis. However, a hidden feature of the macOS Finder lets you merge the files in folders, keeping the newest versions.
You can also watch this video at YouTube.
Watch more videos about related subjects: Finder (317 videos).
You can also watch this video at YouTube.
Watch more videos about related subjects: Finder (317 videos).
Video Transcript
Hi, this is Gary with MacMost.com. Today let me show you how to merge two folders on your Mac.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you can read more about the Patreon Campaign. Join us and get exclusive content and course discounts.
So I'm going to use List View to demonstrate what's going on. Here I've got inside of one folder two folders. Folder A and Folder B. They both have identical Document 1's and you could see here, I have the Preview Pane turned on so you can see what's inside. Document 2 in Folder A is a newer version. I put New Version in it. You could see the older version is here in Folder B. Document 3 is the opposite. There's an older version here and in Folder B there's the newer version. Folder A has a Document 4 that's not in Folder B. Folder B has a Document 5 that's not in Folder A. So the idea is I want to merge these two.
I should get Document 1, which is the same between both, then the newer version of Document 2, the newer version of Document 3, and then both documents 4 & 5 in the final folder. Now one pretty straight forward way to do this is to select all of the files in Folder B. I'm going to use Shift Click to select the range. Simply drag them to Folder A and drop them in. Then we're going to get a hit with this dialogue here. In this case it's going to tell me that Document 1 already exists. The options I have are to keep both which would take the one I'm moving and apply the word Copy to it. Then both would be in the folder. I could Stop which cancels all future actions. So everything just stops right here. Or I can Replace which means that the one I'm moving replaces the one that was originally in the folder.
Now there is another option. If I hold the Option Key down, notice Keep Both changes to Skip. So in this case it would be the opposite of Replace. The version that's sitting there in the folder would stay. The new one would not be copied over. I know that I can Apply To All. If I check this that means whatever I select here for everything else that's going to be copied it's just going to apply that. So, for instance, if I hold the Option Key down and go Skip then it would keep all of the existing documents of the same name in that folder. Only new documents would be copied in there. If I selected Replace then it would replace all documents that have the same name with the ones I'm moving. If I use Keep Both it means for every document that has the same name the one that's being moved would move there but with a new name, the word Copy being after the original name.
Now an alternative is instead of just dragging and dropping into Folder A I hold the Option Key down. That gives me that little green Plus indicator there saying it's going to make a Copy of everything. So now when I do it it seems to be doing the same thing but instead of files being moved out of Folder B, Folder B is going to remain untouched. So I can still do what I want here. I can say Apply To All and Keep Both. Notice also when I copy instead of the word Copy appearing here, ironically, I get a number instead. The problem with doing this is that it is hard to just have the newer versions survive during this type of merge. You have to go through each file meticulously and know which one is the newer version. It's not going to tell you.
Notice, on the other hand, if I select one file here, like this one, and I drag it, it's going to actually say a newer item already exists. Or if I drag this one here it's going to say an older item exists. Unfortunately, it won't do that. I won't tell you which is newer and which is older when you select several files. So you either have to look in each and every match and determine yourself which one to Replace, which one to Skip which is going to be difficult and it's going to be easy to make mistakes. Using Apply To All doesn't really care which one is newer and which one is older. It just looks at them as files that are originally in the folder and files that are the ones moved in. So you could either say I want to use all the ones being moved in when there is a conflict or all of the existing ones when there is a conflict. You can't go and say I want to use the newer or older one.
But there is one way to force it to always accept the newer version of the file. To do that you need to have Folders that have the same name. So we can't do that here. If I try to name this one Folder A it's going to give me an error. It's already taken. So what I want to do is I want to create a new folder and I'm going to call this Temp. It's just going to be a temporary folder. I'm going to move Folder B into it. I'm going to rename Folder B inside this folder, Folder A. So now they have the same name. Now if I were to just drag and drop Folder A into Folder A it just puts one folder inside the other. However, if I were to drag to the folder above, right here, now there's a conflict. I'm trying to move a folder into a location where there is already a folder with that name. It's going to say, do I want to Replace the old folder or not. It still doesn't help us. However, if I hold the Option Key down when I do this indicating I want to Copy this is what happens. I get the same Stop or Replace but now I get this Merge button. This is kind of a hidden feature here. What Merge will do now is combine the two folders and only keep the newer items. So now I'll select Merge and now if I look in Folder A I've got Document 1, which was the same, I've got the newer Document 2, the newer Document 3, I've got Document 4 which was only in A before, and I've got Document 5 which was only in folder B before. Everything is just like I want it. At this point all I need to do is get rid of the Temporary folder with the old copy of all those files. Now I have my merged Folder A.
Of course in many situations you're not going to have to deal with a temporary folder. Folder B is actually going to be a folder of the same name and it's going to be maybe on an external drive, a flash drive, maybe it's on a Server, maybe it's in your Downloads folder or something you just downloaded. It's already going to be in a different location. It already could have the same name as the folder you're merging with. So then it's simply a matter of holding the Option Key down and dragging and dropping one folder on top of the other. So that's how you merge two folders on your Mac.
I hope you found this useful. Thanks for watching.
Great tip Gary, had no idea Merge existed in Finder. On a related note, over the years I learned to take the time to come up with meaningful folder structure and file names, which include modifiers such as, dates, version numbers, etc. That way I know what version I have just by looking at the name. thx
VisualDiffer (https://apps.apple.com/gb/app/visualdiffer/id412386481?mt=12) is your friend for this as the content differences can be inspected before arbitarily getting a file with a more recent time-stamp.
Still, it is handy to know about the facility described by Gary.
Excellent tip, Gary! I have needed this SO many times. Thanks!
Gary, thank you for pointing out these hidden gems! This is so useful and I had no idea this capability was built into MacOS.
Does merging work when there are subfolders within the two folders to be merged? Are the latest files retained in the subfolders? Thx.
Related topic suggestion: How to merge Photos' libraries.
Lawrence: Yes, subfolders are merged too. Try it and see. Photos libraries are a whole different topic. There's no good way to merge them. You have to take the smaller/older/less important one, export the photos to files, then import them into the main library.
I am trying to merge music folders (backing up to an external drive). Do I need to have the total space available to complete the merge. Right now I have the external HD library of 928 GB / 2TB available but I am trying to merge an updated internal library of 982 GB. Currently getting error, not enough space. Trying to save the deltas.
Juan: Not sure I understand your situation. If you have 2TB free, then adding 982 GB, even if it was all new, shouldn't be a problem.
When I hold down the option key, select the folder I want to merge from one drive (not Macintosh HD) into another external drive (the folders have the exact same name), I get a seperate window that opens up asking me to "manage disk space" and not the box with the merge button. What am I doing wrong?
Marc: It's different if you are talking about separate drives. Try the Command key instead. Or, move the folders to the same drive and then do what I show in the video.