58

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.

cregox
  • 5,944

6 Answers6

58

Once in Terminal, type: ditto from_folder destination_folder

Ex:

ditto ~/Desktop/SomeFolder ~/Desktop/SomeOtherFolder

Infallible.

Alexander
  • 408
32

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.

Daniel Beck
  • 111,893
15

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

7

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:

  1. cut&paste
  2. better copy progress dialogs (like in PathFinder)
  3. 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

6

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.

3

There were two "in the meantime" solutions here that I would just not call "simple"... Luckily I've stumbled upon it:

alt text

That's called FileMerge and can be found in /Developer/Application/Utilities when you install the Xcode developer tools from the Mac OSX CD or download it from apple.

It first compares the two folders you selected and then shows the differences. You can then select if you want to merge the files to one destination file.

Still not quite as simple as I suggested, but at least it must be the best "meanwhile" known option if you have about 1.5 GB free for the installation. The "cp" is hard to keep up and the server + Transmit won't let you do it unless it's local.

Now we just need a way to use it without installing Xcode... I'll edit later if I manage to do it - this seems like no simple mater after a lot of googling.

cregox
  • 5,944