How to merge (and not replace) folders when copying on the Mac?
Solution 1
Try MacUpdate, Softpedia and Brothersoft. Search for Folder Merge.
Folder Merge
Small software utility that will merge folder contents
By Default OSX doesn't merge folder contents so this is a simple GUI tool to do just that.
If simply you want to merge the files located in two separate folders, you can easily do that with Folder Merge.
Unison
This is free.
Unison is a file-synchronization tool for Unix and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.
Solution 2
Once in Terminal, type: ditto from_folder destination_folder
Ex:
ditto ~/Desktop/SomeFolder ~/Desktop/SomeOtherFolder
Infallible.
Solution 3
Holding down the Option key on Mac OS X Lion gives you the option to 'Keep Both' which then merges the two folders.
This was one of the new features of Mac OS X 10.7 Lion.
Solution 4
I'm a proponent for full-blown support for merge-replace-skip in the Finder, no question. In fact, it's disheartening that Apple's simplicity-minded philosophy actually results in more mouse movement, more clicks, and more steps to accomplish what seem like simple things. And clearly people want to see this kind of change (among many others) in the Finder, especially. Snow Leopard has made some steps towards FTFF with the Cocoa-rewrite.
Thanks to this Cocoa-rewrite, bliss has arrived in the ability to extend/hack the Finder in Snow Leopard with plug-ins thanks to SIMBL, which provides means for hacking/reverse-engineering Cocoa-based apps. So I figure it's only a matter of time until someone extends Finder to support this more natively. Regardless, Apple is still to blame for the Finder flaws, and they need to own up soon and just Fix the Freakin' Finder, once and for all! (I mean, it is so central to the OS you'd think they'd have done this by now.) < /rant >
Meanwhile, you can fool Transmit into using its merge capabilities with your local files: http://andrew.hedges.name/blog/2007/01/16/merge-folders-with-transmit
Solution 5
I'm the author of TotalFinder SIMBL.
Replace instead of "copy over" is a big issue in Finder I think. I know two people personally who lost data because of this "feature".
On the other side I understand why it is designed this way. I guess the reason is moving application bundles. Application bundle is nothing but folder, when you drag app update to Applications folder you want to replace old app bundle completely without leaving old files in (imagine some app's author is checking existence of some files in Resources subfolder of his bundle).
Ok, so Finder removes a previous folder. But the wrong behavior is that it does not place it into Trash. It deletes it permanently which is really sad and unexpected.
As of TotalFinder modifying this behavior. It is not easy to tweak this process from SIMBL. I'm thinking about replacing whole copy/move functionality of Finder with my own. This would enable me to do several requested features at once:
- cut&paste
- better copy progress dialogs (like in PathFinder)
- implement copy over semantics
The problem here is that it is a lot of work with uncertain results.
In the meantime you have to use Terminal.app with cp -r source/folder destination/folder
Related videos on Youtube
cregox
sen+cregox@ ahoxus.org (apparently mailto: doesn't work here) legacy "about me" wonder if we got email notifications on this network partially thanks to my ranting. used to think flair rocks (like stackoveflow) but i was blind. :( be sure to visit my current and only project since circa january 2019: AHOXUS previous display name: Cawas (up to 2015 dec 21) profile kind of superficially updated on 2021 feb 11, before i started deleting everything almost 1 year before.
Updated on September 17, 2022Comments
-
cregox over 1 year
There's a similar question about windows. This is the same, but for mac. By the way, it's odd there's no question on this yet, since it seems like it's the most hated thing on Mac OS X.
If I try to copy or move a folder to somewhere it already exists, it asks to replace it. That would result in deleting the target. Rather I want to merge.
There's already a aquataskforce request about this, and it's a discussion going for a long time if it's even something that should exist on Mac, due to its whole philosophy. Discussions at Apple are outdated and didn't help much as well.
As usual, there are professional solutions for doing this, such as Changes and Araxis. And there is the rsync or command line alternatives. But I want a free and simple solution, something like how it is done in Windows or Linux. I won't be doing it much anyway. By the way, PathFinder don't have such option as well and FolderMerge doesn't work on Snow Leopard as far as my 1 test went.
Suggestions to whom may come up with a solution:
I think a good idea would be to move everything non-exact-duplicate to the same folder, and leave every duplicate behind. No confirmation is needed in this case, and I can easily check the duplicates later. If it's copying merge, then the target folder will contain everything, and the source will be rather untouched. Duplicate-check is just on the file name. Leave any more complicated thing to third parties.
-
Josh K about 14 yearsTransmit rocks.
-
cregox about 14 yearsThat's something I might try later on, if nothing better pops up. :P
-
user3055603 about 14 yearsIt was bugging me to no end, so I searched and searched until I found that reference to Snow Leopard extensibility I mentioned above. And while Apple did pave the way for Finder plugins/extensions by rewriting the Finder in Cocoa, the pluggable nature actually comes not from Apple directly, but from a little gem called SIMBL (Simple Bundle Loader, en.wikipedia.org/wiki/SIMBL)
-
user3055603 about 14 yearsLong story short, it enables hacks and plugins for Cocoa based apps. AKA Cocoa hacking! ... More details about this "application enhancement loader" can be found here: culater.net/software/SIMBL/SIMBL.php ... There are already a number of plug-ins (and growing): code.google.com/p/simbl/wiki/SIMBLPlugins (and of course, any Finder extensions require Snow Leopard).
-
user3055603 about 14 yearsHere's the development wiki for anyone interested in diving in and making a Finder bundle for merging files and folders: culater.net/wiki/moin.cgi/CocoaReverseEngineering ... As I said, once people get a hold of this info, it's only a matter of time before someone develops this functionality. I just wish I had to time to do it myself! :)
-
user3055603 about 14 yearsBy the way, the plugin I had original come across that lead me to SIMBL was called TotalFinder and it fixes a lot of really nagging annoyances in the Finder (FTFF FTW!). Among other things, it adds options to the Finder for supporting: a global keyboard shortcut (hotkey), tabbed file browsing, dual panel and folders on top! Check it out: totalfinder.binaryage.com ... (Maybe we could get these guys to add merge support themselves?)
-
cregox about 14 years@purefusion That's pretty cool stuff. I just hope those hacks and plugins won't bloat finder up too much! On a side note, I'd say you could have edited your answer once again rather than writing all those comments. It's generally a better practice here in SO. ;)
-
Bryan about 14 yearsAdd me as a third person who lost data due to this. The data wasn't important fortunately, but it was annoying non the less. - Of course had I have read the message properly, it wouldn't have happened. But I was in disbelief when finder didn't even put the deleted directory into trash. FTFF Apple!
-
user3055603 about 14 yearsExcellent work on TotalFinder, I must say! I'm thankful for Apple's Cocoa-ifying the Finder so you could make your masterpiece. I occassionally get flamed for being "resistant to change" but I grew up on a Mac, not a PC. Apple is the one refusing to change, and I quote Steve, "because we like the behavior of the Finder"
-
user3055603 about 14 yearsThe least they could do is make it more customizable (and hey, MS is at fault here too, just not on the same level). Having spent time to provide a solution to the issue yourself, even if via hacks, makes Macs more tolerable, so I respect you very much for doing that. Meanwhile, investing more time in a merge solution is a tricky venture, because at that point, you're dealing with users' data, which is something you want to approach very cautiously and with a lot of testing. I'd hate to have been one of the unlucky subjects of the recent Snow Leopard data loss bug.
-
cregox about 14 yearsIn this end, your "meantime" solution still is the best. At least from my point of view.
-
cregox over 13 yearsJust as an addition, SyncTwoFolders looks pretty good: superuser.com/questions/206041/mac-software-to-merge-folders/…
-
stib over 13 yearsshouldn't it be cp -Rn source/folder dest/folder? The -n switch means don't overwrite any existing files. And according to cp's man page there is no -r option (though weirdly enough it still works).
-
user3055603 over 10 yearsShouldn't have to hold down option to get the prompt, but it's still better than the other solutions, given that it's built-in. Thanks for adding this here!
-
Michael Innes almost 10 yearsUnfortunately, holding down the Option key will Copy instead of Move the files.
-
JVC almost 10 yearsIs it my imagination or is this option no longer available in Mavericks??
-
tyron almost 10 years@JonathanvanClute seems the "Merge" option is available when you copy the folder. So far, I guess the best solution is to copy/merge folders, and then delete the original (doesn't seem like an Apple solution, but still works..)
-
JVC almost 10 yearsIt's not available for me on copy either... how are you getting it to appear?
-
HikeMike almost 10 years@JonathanvanClute: Are you pressing
Option
while the dialog is shown? -
JVC almost 10 yearsYes... nothing happens like it used to pre-mavericks. No change in the button states, nothing.
-
HikeMike almost 10 years@JonathanvanClute: When copying, I get a dialog with three options, one of then Keep Newer, which is probably more descriptive than Keep Both.
-
JVC almost 10 yearsNope... nothing of the sort. All I get is Don't Replace, Stop, and Replace. Option key does nothing.
-
HikeMike almost 10 years@JonathanvanClute Are you copying only one element?
-
JVC almost 10 yearsI'm copying a folder fill of files.
-
Roberto about 8 yearsLooks like "Merge" in El Capitan will pick the newest file instead of the file from the "from" folder... am I right?
-
publicJorn over 6 yearsNote that
ditto
overrides a file at at destination if it has the same name. Even if the destination file is newer.