Directory Compare provides a method of identifying differences between contents of the directories and supports synchronizing selected or all differences of the selected files.
To compare two directories, perform one of the following steps:
Files and Folders are compared by comparing all the files in the two directories based on their file sizes, contents, or timestamps. The Preview Pane shows the contents of the selected directories in the left and right panes. Different icons indicate the state of the contents in the * column. Files/Folders present in only one directory are indicated by ,
icons. Files/Folders that are equal are indicated by
and files/folders that exist in both directories but are different are indicated by
. The contents of the selected file are shown in the lower pane, also known as the Differences pane with the differences highlighted. This pane is further split into a split-pane where each file takes up half of the pane and shows connecting splines for identifying where the deletions, changes and additions occur. Comparisons show the character differences in a modified line with bolding and background color highlights indicate modified blocks. If they are not identical they are highlighted by default in pink (deleted), purple (changed) or green (added). These colors can be changed from the Options dialog. You can also use this tool to synchronize the contents of the directories
.
This table lists the icons on the Preview Pane toolbar.
Icon | Description |
---|---|
Saves and refreshes changes made to the contents of the compared directories in the tool or on your local system. | |
Filters the comparison result based on user-selection. | |
Displays the comparison result by content, size, and timestamp. | |
Saves changes made to the contents of the compared directories in the tool. | |
Allows synchronizing differences between the selected file or all files in both the directories. | |
Opens the Help topic associated with Directory Compare. | |
Filters the comparison result on a filter string. Asterisk (*) wildcard is supported. | |
Allows switching directories for compare. |
You can compare files of the directories against the file size, content, or timestamp. You can use or filter functionality to narrow down or widen your result. You can view the total differences found and assigned color code at the bottom-left of the Differences pane.
When working in Directory Compare, you can save in two modes:
You can limit the number of files/folders displayed in the Preview pane by typing a filter string in the Filter text box. You can also apply a filter to a specific file set using the toolbar toggles. To do this, select the toggles and then apply a filter. The tool only filters results that match the string within the file set.
You can change directories for compare. To change directories, click and then choose the new directories in the Select Path dialog and then refresh the comparison result.
You might have several versions of files or folders related to your project locally in different folders. If you need to merge changes and synchronize folders, then you can use the synchronization functionality that allows moving files from one folder to another, synchronizing selected or all files, and synchronizing individual changes between files.
To synchronize files between folders
You cannot undo this action.
You can also use these right-click options to synchronize files.
Right-Click Action | Description |
---|---|
Set Copy to Right | Copy the item from the left side to the right side. This option is disabled if the file is present only in the right side. |
Set Copy to Left | Copy the item from the right side to the left side. This option is disabled if the file is present only in the left side. |
Set Delete | Delete file after synchronization. This option is disabled if the file is present in both folders. |
Set Do Nothing | Make no changes to the file after synchronization. |
Set Default | Set to the default action. |
Warn When Delete | Display a popup containing a warning before deleting the file. |
To synchronize individual changes between files, you can use these icons:
You can undo this action.
You can use these right-click actions in the Differences pane.
Right-Click Action | Description |
---|---|
Select Change | Select the line containing the difference. |
( | Delete the different content from the file. |
( | Add the missing content existing only in one file, to the corresponding file. |
( | Overwrite the contents of the corresponding file. |
On selecting a file, you can view the differences between the left and right files with different color codes in the Differences pane. The differences between both files are shown side-by-side.
You can perform these actions in the Differences pane.
Action | Description |
---|---|
View the count of total differences. | |
Define how the difference engine should treat white spaces in the text.
| |
Let’s specify how the difference engine calculates and highlights granularity differences.
| |
Scroll both files in the Differences panes simultaneously. When disabled, you can scroll both files individually. | |
Configure the settings for the Differences pane by using these options.
| |
View the previous and next differences. |
For each pane, you can find specific text by using various toolbar options and keyboard shortcut keys. To invoke the Find toolbar, click anywhere in the pane and then press CTRL/Command+F.
This table lists the keyboard shortcuts.
Shortcut | Description |
---|---|
F5 | Refresh the content of the files. |
Enter | Synchronize the selected file. |
Ctrl+Enter | Synchronize all files. |
Shift+Enter | Browse a different file. |
F7 | Move to the next difference. |
Shift+F7 | Move to the previous difference. |
Ctrl/Command+Tab | Shift between the current position and the previously selected position of opposite pane. |
Ctrl/Command+Shift+Tab | Shifts the cursor to the Filter text box. |