How to compare two folders on a Mac and sync them
Updated
Finder on macOS has no way to compare two folders. You can list the differences in Terminal with diff -qr folder1 folder2, or use a separate app.
Haemil Explorer's "Compare Folders" puts two folders side by side, colors each item as same, different or only on one side, and copies just the items you pick to the left or right. "Sync…" shows every planned change first and changes nothing until you click the button. Deleted files go to the Trash, and one ⌘Z undoes the whole sync. It is a Pro feature, and you can try it free for the first 14 days.
Compare in Terminal
To list the differences, run diff -qr folder1 folder2. Files on one side only show as "Only in", and files whose contents differ show as "differ". The command only reads.
To preview what a copy would do, run rsync -avn source/ destination/. The -n flag lists the files without copying anything. Without -n, rsync copies right away, so check with -n first. Both commands were run on macOS 26.6 for this guide.
Terminal commands do not keep overwritten files in the Trash, and there is no undo.
Open a comparison in Haemil
There are three ways. In dual pane, open the two folders and choose "Compare Folders" from the ⋯ menu. Or select two folders, right-click and choose "Compare Folders". Or right-click one folder, choose "Compare with Another Folder…" and pick the other one.
A new tab shows the left and right folders side by side. The ⇄ button swaps them.
Quick and Exact
Quick compares size and date modified. Exact reads files of the same size on both sides and compares them byte by byte.
Each folder row sums up how many items inside differ or exist on one side only. Turn on "Differences only" to hide matching items.
For a text file, press Enter to see both versions side by side with line numbers and changed lines highlighted.
| Status | Shown as | Meaning |
|---|---|---|
| Same | Dimmed | Both files match |
| Different | Orange | The files differ. The more recently modified side has its date in bold |
| Left only | Blue | Only in the left folder |
| Right only | Green | Only in the right folder |
| Couldn't compare | Gray | Could not be read. Hover over the status to see why |
Copy only what differs
- Select the rows to copy. Hold ⇧ or ⌘ while clicking to select several.
- Click "→ Copy to Right" or "← Copy to Left". Both are also in the right-click menu.
- If names clash, Haemil asks once. When it finishes, it compares only the changed items again.
For a folder on both sides, only the differing items inside are copied. A folder on one side only is copied whole. Matching files are skipped.
Overwritten files go to the Trash, and ⌘Z undoes the copy. Copying never deletes anything on either side.
Three ways to sync
| Method | What it does |
|---|---|
| Left → Right | Makes the right match the left. New and changed files on the left are copied to the right |
| Right → Left | The other way round |
| Two-Way | Files on one side only go to the other side, and differing files follow the more recently modified side |
Preview the sync before it runs
Click "Sync…" in the comparison's top bar and the sync view opens in place of the table. It lists the planned changes first, grouped as Copy to Right, Copy to Left, Replace, Move to Trash, conflicts and skipped items, with counts and sizes.
Uncheck any item or group to leave it out. The run button spells out what will happen, for example "2 copies, 1 replacement, 3 to the Trash".
"Match to the newer one" is on by default and keeps the file with the later date modified. In a one-way sync, if the file on the side being updated is newer, Haemil marks it as a conflict instead of overwriting it.
"Delete files on one side only" is off every time the window opens. Turn it on to move files that exist only on the side being updated to the Trash.
Guards against mistakes
If more than 100 files or more than 1GB would go to the Trash, Haemil shows a warning and asks again when you click.
Deleted files go to the Trash one by one. Nothing is deleted permanently.
Right before it runs, Haemil checks that each file is still as it was when compared. Files that changed in the meantime are left alone and reported as errors.
One ⌘Z undoes the whole sync. Copied files go to the Trash, and overwritten and deleted files come back from the Trash to where they were.
Files that are only in iCloud are never read, overwritten or deleted, and are skipped. Syncing a folder with itself or with a folder inside it is blocked.
Compare code folders
The Exclude box starts with .git, node_modules, .DS_Store, target, build, dist and DerivedData. Separate names with commas, and use * and ? as wildcards.
"Use .gitignore" is on by default and applies the rules from both .gitignore files to both sides. Sync follows the same exclusions as the comparison.
Terminal and Haemil side by side
| Task | Terminal | Haemil Explorer |
|---|---|---|
| List differences | diff -qr | Color-coded side-by-side table (Pro) |
| Preview a copy | rsync -avn | Planned changes in the sync view (Pro) |
| Overwritten files | Gone | Moved to the Trash |
| Undo | None | One ⌘Z for the whole sync |
FAQ
How do I keep an external backup drive up to date?
Put the original on the left and the backup on the right, and choose "Left → Right". To delete files from the backup that you deleted from the original, turn on "Delete files on one side only". Those files still go to the Trash.
Does it sync automatically on a schedule?
No. A sync runs only when you click the button.
Can it replace Time Machine?
Sync makes two folders match. It does not keep earlier versions you can go back to, so keep using Time Machine for backups.