Merge supports folder hierarchy comparison and synchronization, enabling you to compare and merge entire directory trees. This is ideal for detecting changes in different versions of source code or web pages. You can even use the efficient byte-by-byte comparison option to verify the contents of USB thumb drives or recordable CDs.
Spending a few moments browsing the Instant Overview of Folder Comparison and Synchronization will help you quickly become familiar with Merge folder comparisons. It may also be helpful to review the Making the Most of the Ribbon topic.
Starting a comparison
To open a new folder comparison:
- Choose the New folder comparison item in the drop-down menu of the leftmost ribbon item.
- Or, if you are already viewing a folder comparison, click the New folder comparison button in the ribbon.
- Or, press Ctrl+D.
Changing the comparison layout
By default, fresh installations of Merge open folder comparisons with the Two-way with file comparison layout:
This layout splits the display, with the folder comparison on top and a file comparison for the selected row in the folder comparison underneath. The ribbon shows buttons for either the folder comparison or the file comparison, depending upon which comparison has focus. Click on either of the comparisons to change the focus. The application window caption bar indicates the type of the active comparison.
The Two-way with file comparison and Three-way with file comparison layouts offer a very convenient mechanism for reviewing (and potentially merging) many files in a folder comparison.
Merge endeavours to remember the preferred folder comparison layout when opening new folder comparisons.
The rest of this article focuses upon the folder comparison alone. Thus, if necessary, make sure that the folder comparison has focus and then click the Two-way (vertical) ribbon button to switch to the two-way, folder-comparison-only layout.
The layout of the folder comparison window is very similar to that of the text comparison window.
Specifying the folders to compare
Enter the paths to the folders you want to compare into the entry fields at the top of the comparison tab, or use the Browse and Show history buttons to choose folders.
The Browse button opens a folder-browsing window and the Show history button displays a list of the folders that you have recently compared. Double-click a row in the list to load and compare the relevant folders. Alternatively, hold Ctrl and double-click a folder in the list to choose only a single folder.
You can also drag and drop folders from File Explorer on to the entry fields in the folder comparison window.
When you have chosen the two folders to compare, click the Start or recompare button in the ribbon, or press the Enter key while one of the folder name entry fields has focus.
You do not need to wait for the folder comparison to complete before viewing or using the results of the comparison.
As well as folders on the local disk and network volumes, Merge is also able to access and compare folder hierarchies directly within Perforce and Subversion repositories. See Virtual File System (VFS) Plugins for more details.
Comparing archive files as if they were folders
Merge has built-in support for a variety of archive formats (
.tar, etc.) – see the Scan contents of archives (.zip, .jar, .tar, etc.) option documentation for a complete list. Enhanced support for
.7z archives can also be provided by installing the free third-party 7-Zip application and enabling the corresponding Merge option.
If you have already performed a folder comparison and have a row of results that contains two (or three) corresponding archive files, simply double-click that row to launch a new folder comparison tab to compare the contents of those archives.
You can also enter an archive file path directly into the folder entry field at the top of the folder comparison tab. For example, you could enter the archive file
Note that you can compare the contents of an archive to a normal folder. This can be useful to verify the contents of a newly created archive, or to see which files have changed since its creation.
Accessing other revisions of a folder with the Versions button
If there are other versions of the folder named in the entry field available for comparison, the Versions button displays a list of these other versions. You can open the same file or folder in both the left and right comparison panes, then use this button to compare a folder with another revision of itself.
When the options window Application▸Show file versions from SCM systems option is checked, Merge endeavours to find any other versions of the folder you are comparing from the relevant software configuration management (version control) system repository. If a Git, Mercurial, Subversion, or Perforce URI has been specified in the filename entry field, Merge will search the repository from which it accessed the folder for any other revisions. Otherwise, if a folder has been loaded from the local disk or a network volume and is part of a client workspace, Merge will search the relevant repository for which credentials have been supplied on the Credentials options page.
If the options window Application▸Show file and folder versions from System Restore option is checked, Merge will show any versions of the folder you are comparing that have been stored by Windows System Protection. For more information, see Accessing Versions Stored by Windows System Protection.
Three-way folder comparisons
The folder comparison display
The screenshot above shows the results of a typical comparison between two folders. Background colours are used to indicate the inserted, removed, changed, or unchanged state of each file or folder in the results list. The icon of the newest file in any given row is indicated by a red square adornment. Any differences in the case or Unicode normalization of filenames within a row are highlighted.
You can adjust the widths of the columns in the comparison by dragging the column heading dividers from side to side.
The Fonts and Colours options page determines the colours used for inserted, removed, changed, and unchanged files and folders.
Right-click a file or folder within the folder comparison results list to display a context menu containing commonly used commands. Some of the available commands will change depending on whether you click an item on the left or right side of the comparison.
Several optional columns can be turned on and off using items in the ribbon Options menu.
The Changes column is toggled using the Options ▸Show changes column command. This column indicates the number of changes that have been made between the files in the two adjacent columns. (In some circumstances, the precise number of changes is not calculated and is shown as 0, 1, or ≥1. For more information, please see the folder comparison Method options page topic.) For three-way folder comparisons, a third Changes column indicates the number of changes between the first and third folder hierarchies. Other symbols can appear in the Changes column to indicate errors encountered while processing the files in a row, or to indicate that a row is filtered out by option settings. In either case, hover the pointer over the symbol for more information about what it represents.
Use the Options ▸Show timestamps and sizes command to toggle the display of file timestamps and sizes.
The Options ▸Show executable file and product versions menu command toggles the display of version information for executable files.
Unicode code points
It is possible for filenames that look the same to contain different Unicode code points. Use the ribbon Options ▸Show Unicode code points command to toggle the display of Unicode code points alongside file and folder names. This can help determine why names differ when they appear to be composed of identical characters.
Selecting files and folders
You can select files and folders in the results list in the following ways:
- Use the commands in the ribbon Select rows menu to select rows in a variety of different ways.
- Click an item to select it and deselect any other selected items.
- Hold down Ctrl and click an item to add or remove it from the current selection.
- Hold down Shift and click an item to extend the selection to that item.
- Press Ctrl+A to select all the files in the results list.
Launching file comparisons
The results list can be used to launch file comparison windows for selected rows of files. Please see the Launching File Comparisons topic for more information.
Launching folder comparisons
You can double click any row containing folders to open a separate folder comparison window to compare those folders.
Showing a file comparison for the currently selected folder comparison row
Use the Two-way with file comparison or Three-way with file comparison ribbon buttons to split the display horizontally, with a file comparison shown beneath the folder comparison. Click a row in the folder comparison to compare that row’s files in the file comparison below.
Use the Two-way (vertical) or Three-way (vertical) ribbon buttons to turn off the file comparison display.
Deleting files and folders
To delete files in the folder comparison window, select the files and folders that you wish to remove and press the Delete key. Alternatively, use the Delete selected ribbon command.
You can usually undo a deletion by restoring the deleted files and folders from the Windows recycle bin.
Hiding files and folders
You can hide files and folders in the results list by selecting them and then using the commands in the ribbon Hide/reveal menu.
You can later show all hidden items using the Show hidden rows as dimmed command on the same menu.
Note that hidden items are not excluded from subsequent folder comparison operations. They will still be compared, but will not appear in the results list until you use the Show hidden rows as dimmed command.
Excluding files and folders from a comparison
You can specify wildcard expressions to exclude files and folders from the folder comparison. Files and folders that are excluded in this way will not be compared and will not appear in the results list even when you choose the Show hidden rows as dimmed command. You can use this feature to exclude large binary files or entire folder hierarchies from the comparison.
Bookmarks and comments
As you are comparing or editing files, you may want to set bookmarks to enable you to return to locations of interest later on. Press Ctrl+F2, or click Toggle bookmark in the ribbon, to toggle a bookmark on or off on the current line. To navigate between bookmarks, press F2 or Shift+F2, or use the Next bookmark and Previous bookmark buttons in the ribbon.
Comments can be added to bookmarks, making it easy to note important information or to record a question. To edit a bookmark’s comment, right-click the bookmark and choose the Edit Comment menu item. Bookmark comments are shown as tooltips when you hover the mouse pointer over a bookmark.
Bookmarks and comments are included when you create an HTML comparison report or save a comparison for archival or team collaboration. They are therefore a useful tool for asking questions or making notes in a comparison that will later be emailed to other team members for review.
Customizing folder comparisons
There are a variety of options that can be adjusted to change the way that Merge performs folder comparisons. These options are discussed in the The Options Dialog topic.