OSX: How to compare and merge two folders and their subfolders and differing files of the same origin
The rsync command line tool is able to merge two folders.
You'll need to open a terminal window. Take a look at the manual pages

man rsync 


There may be a one liner but the following steps are non-destructive since you won't change your source folders.


Create a new folder (dest)
Sync source1_path to dest
Sync source2_path to dest 


Here the script - check the manual pages for additional options

rsync -rv source1_path/ dest
rsync -rv source2_path/ dest


The following commands also create copies for non-identical files which exist in both source directories (with a difference in size or timestamp for example)

rsync -rv --backup --suffix=_source1 source1_path/ dest
rsync -rv --backup --suffix=_source2 source2_path/ dest