Where did folder "merge" or "keep both" go in OS X 10.9 Mavericks?

OK. I found out myself... Luckily Apple did not remove the Finder Merge functionality with Mavericks. But sometimes it is not offered to the user. But let me explain:

Supose you have a folder named TARGET with a subfolder TARGET/SomeStuff. And you have a SomeStuff folder somewhere else. Now drag this second SomeStuff folder to the TARGET folder (without any modifier keys pressed) then the Finder will presented you the following dialog (Stop and Replace):

enter image description here

So, no merge here.

Now - if you instead press the Alt key while you drop the SomeStuff folder to the TARGET folder there are two possibilities:

1.) If the files in the two SomeStuff Folder have completely different (not overlapping) contents. In other words: no duplicate filenames. Then finder will give you these options (Stop, Merge & Replace All):

enter image description here

So, here you can merge. And the result will be a TARGET/SomeStuff folder with the content of both SomeStuff folders.

2.) But here comes what is sometimes confusing (and actually made me think merging is gone in Mavericks): if there exists at least one filename that is contained in both SomeStuff folders, then merging is not possible. Then the finder will offer you these options (Don't Replace, Stop, Replace):

enter image description here

So, no merge possible, here too!


Short answer

Using the command line (Terminal):

cp -r -n ~/Desktop/src/* ~/Desktop/destination/

The command above adds the src content and the subdirectories to the destination without overwriting the content already present in the destination.

Long answer

Even if the content overlaps, you can still use cp to do it. Assume that you have two folders on your desktop: the src and the destination folders and you want to merge src into destination:

enter image description here

To merge, just do:

cp -r ~/Desktop/src/* ~/Desktop/destination/

NOTE When you use this, the content in src overwrites the content in the destination folder and adds the extra stuff that are missing in the destination. It shouldn't matter if you just want to add the missing files from src into destination.

ALSO it doesn't matter how many subdirectories are there, it will just go through each folder recursively and it will overwrite the content and will add the stuff that is missing in the destination folder.

BUT

PITFALL If you have huge files (like video files), you don't want to wait until everything is overwritten, it adds a lot of overhead.

PITFALL SOLUTION: Instead, you can use the -n flag to skip the overwriting:

cp -r -n ~/Desktop/src/* ~/Desktop/destination/

This is the description of the -n flag from the man page:

man cp
 -n    Do not overwrite an existing file.  (The -n option overrides any
       previous -f or -i options.)

Further Reading

  1. https://stackoverflow.com/questions/5088332/overhead-of-a-flag-in-cp-command