When organizing files on your Mac, you will often find yourself with two folders sharing the exact same name in different locations. Perhaps you have a “Photos 2024” folder on your Desktop and another “Photos 2024” folder in your Documents. When you drag one into the same location as the other, macOS triggers a warning prompt.
Handling this prompt incorrectly can result in catastrophic data loss. If you click the wrong button, macOS will completely delete the contents of the destination folder and replace it with the folder you just dragged over. To combine the contents of both folders safely, you must use the hidden “Merge” function.
Understanding the macOS Warning Prompt
When you drag a folder named “Project Assets” into a directory that already contains a folder named “Project Assets”, macOS pauses the action and displays a dialogue box that usually says:
“An older item named ‘Project Assets’ already exists in this location. Do you want to replace it with the newer one you’re moving?”
By default, you are usually presented with two buttons: Stop and Replace.
- Stop: Cancels the action entirely. Nothing is moved.
- Replace: (DANGER) This will completely delete the existing folder and all its contents, replacing it with the new folder you dragged over. If the old folder contained 100 files and the new one contains 2 files, 100 files are gone forever.
How to Access the Hidden “Merge” Button
To safely combine the two folders without deleting anything, you must reveal the hidden Merge option.
- Ensure both folders have the exact same name. (e.g., “Tax Documents”).
- Click and drag the first folder into the directory containing the second folder.
- Crucial Step: Before releasing your mouse button to drop the folder, press and hold the Option (⌥) key on your keyboard.
- Release your mouse button while still holding the Option key.
The warning dialogue box will appear, but because you held the Option key, the options have changed. You will now see a third button: Merge.
Click Merge. macOS will now combine the contents of both folders. All files from both folders will be placed inside a single folder. If there are files with the identical names inside both folders, macOS will usually keep both by appending the word “copy” to the newer file, ensuring zero data loss.
What if the Merge Button Does Not Appear?
If you hold the Option key but the Merge button still does not appear, one of two things is happening:
- The folders do not have the exact same name: “Photos” and “photos ” (with a trailing space) are technically different names. macOS will simply place them side-by-side rather than prompting a merge.
- Both folders contain files with the exact same name AND identical modification dates: The Merge feature only appears if the folders contain different files, or versions of the same file with different save dates. If the two folders are perfectly identical in every way, macOS assumes a merge is redundant and only offers to Replace or Stop.
The Terminal Alternative: The ‘ditto’ Command
If you are merging massive folders (hundreds of gigabytes) and do not want to rely on the Finder GUI, or if you are merging folders across a network drive where Finder gets confused, you can use the Terminal.
The macOS Terminal has a built-in command called ditto which is specifically designed to safely merge directories.
- Open the Terminal application.
- Type
ditto -V(ensure there is a space after the V). - Drag the Source folder from Finder into the Terminal window (this auto-fills the file path).
- Type a space.
- Drag the Destination folder into the Terminal window.
- Press Enter.
The -V flag (verbose) will print every file to the screen as it safely copies them over, merging the contents without deleting anything in the destination folder.