Directory Compare provides a method of identifying differences between contents of the directories and supports synchronizing selected or all differences of the selected files.
Contents
Launch the Directory Compare Tool
To compare two directories, perform one of the following steps:
- In the Files Browser, select directories for compare > right-click > Compare > Show Differences.
- On the Aqua Data Studio menu bar, click Tools > Compare > Directory Compare and then browse directories. You can also choose directories not listed in the Files Browser, but are saved on your computer. It is also possible to drag items saved on your computer and drop them off in the File/Directory Compare Tool dialog.
Comparison Result
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 .
Toolbar Actions
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. |
Compare Folders/Files
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.
Refresh and Save
When working in Directory Compare, you can save in two modes:
- Refresh: saves and refreshes each file, no matter whether the files have been changed from Directory Compare itself or the local directories on your computer. Refresh also displays or removes files or folders added or removed to the compared directory locally.
- Save: saves changes made to the files from Directory Compare. If you do not save the changes that you make in a file from Directory Compare but edit and save the same file locally, and then try and save the same file in Directory Compare, you are prompted to reload the file from the file system or keep changes in memory.
Filter
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.
- To show or hide files that exist only in the left or right directory, click the or toggle key on the toolbar.
- To show or hide files that exist in both directories but are different, click the toggle key on the toolbar.
- To show or hide equal files in both directories, click the toggle key on the toolbar.
Switch Directories for Compare
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.
Synchronize Contents of Directories
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.
Synchronize Files
To synchronize files between folders
- Select files, and then in the * column, click the icon and specify an action.
- the file will be copied from the left side to the right side. If a file already exists to the right-side, then that file will be overwritten.
- the file will be copied from the right side to the left side. If a file already exists to the left-side, then that file will be overwritten.
- the files are treated equally. No action will be taken.
- the files are different. No action will be taken. To synchronize such files, right-click on the icon and then set copy to right or left. You could have read-only files in the compared directories. Read-Only files cannot be changed directly from the Directory Compare. If you do so, you are prompted to either reload the file or cancel the action. Either way, you will lose your changes. We recommend you change the local version of the file and then refresh the file in Directory Compare.
- the files are present only in one of the folders and will be removed during synchronization.
- To synchronize the selected item, click on the toolbar. To synchronize all the items, click the Synchronize All button on the toolbar.
You cannot undo this action.
Right-Click Actions in the Preview Pane
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. |
Synchronize Individual Changes Between Files
To synchronize individual changes between files, you can use these icons:
- | | | : Click to synchronize individual differences in both files selectively.
- After performing this action, click and sync changes to the local file.
You can undo this action.
Right-Click Actions in the Differences Pane
You can use these right-click actions in the Differences pane.
Right-Click Action | Description |
---|---|
Select Change | Select the line containing the difference. |
()Remove | Delete the different content from the file. |
()Insert | Add the missing content existing only in one file, to the corresponding file. |
()Replace | Overwrite the contents of the corresponding file. |
Differences Pane
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. |
Find
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.
- When you insert a string in the text box, the find operation immediately highlights every occurrence of the searched string in the current pane. To navigate between occurrences, use toggle buttons (, ), shortcut keys; F3 (next occurrence) or SHIFT+F3 (previous occurrence).
- Additionally, you can:
- Set the search criterion such as using regular expressions, case-sensitive, and complete text match.
- Add, delete, select/unselect all occurrences from the find operation by using toggle buttons (,,).
- View the count of the found occurrences in the upper-right corner of the toolbar.
Keyboard Shortcuts
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. |