The folder comparison window supports automatic merging of folders into a common ancestor folder in a similar manner to the file comparison window. The first and third folders will typically be independently modified copies of the common ancestor (middle) folder.
The automatic merging operation will merge changes from the first and third folders back into the common ancestor folder. The operation can involve removal, copying, and merging of files.
To perform an automatic folder merge:
-
Perform a folder comparison between three folders. Merge will assume that central folder is the common ancestor of the first and third folders.
-
Make a backup copy of the common ancestor folder. Merge cannot undo changes that it makes to the contents of the common ancestor folder.
-
Select the rows in the folder comparison results list that you want to include in the automatic merging operation. You can select all files in the list by pressing Cmd+A. Folder selections are ignored.
-
Click on the Merge to Common Ancestor
button to review what will be done by the merging operation.
-
Review the proposed operations in the Merge to Common Ancestor window and click the Merge button to begin the operation.
-
Merge will perform the merging operation, reporting any errors or warnings as they are encountered.
When an automatic merging operation finishes, the folder comparison window will be updated to show what happened during the operation.
If you have enabled the option to Hide Unchanged Rows in the View menu, files that are now unchanged as a result of the merging operation will disappear from view.
Files that were successfully operated upon will be marked as Resolved, and their names will appear dimmed.
A bookmark icon will appear in the left margin of the results list to indicate what happened to the common ancestor file. A comment is often attached to the bookmark. To see the comment, hover the mouse pointer over the bookmark or right-click on the bookmark and select Edit Comment... from the context menu.
A conflict bookmark is attached to files that either could not be merged due to merging conflicts or unexpected errors. In either case, the bookmark comment will describe the problem.
Files that could not be merged automatically due to merging conflicts should be merged manually using the file comparison window.
Merging rules
The following rules define what will happen to selected files during an automatic merging operation:
-
A file that only appears in the common ancestor folder will be removed.
-
A file that appears in the first folder but not the third, or in the third but not the first, will be copied into the common ancestor folder. The copied file replaces any existing file in the common ancestor folder.
-
No action will be taken if a file appears in the first and third folders and if either of those files (or the file in the common ancestor folder, if present) is considered by Merge to be a binary or image file. Binary files are those matching filename patterns for type ‘Binary Comparison’ on the File Comparisons > File Types preferences page. .DS_Store files are assumed to be binary files and will not be edited by Merge. Image files are those matching patterns for type ‘Image Comparison’ on that same page, or those designated as image files by the Uniform Type Identifier information registered with Mac OS X.
-
A text file (i.e. anything not considered by Merge to be a binary or image file) that appears in the first and third folders will be automatically merged into the common ancestor file. The rules for performing this type of merge are the same as those used by the file comparison window to merge two files into a common ancestor. If there is no existing file in the common ancestor folder, the automatic merge will only be possible if the file is unchanged in the first and third folders.
