Compare files, folders, and text sources
RubyMine lets you review the differences between any files, folders, text sources, or database objects, as well as between local files and their repository versions.
Compare files
RubyMine displays the differences in the Differences Viewer for Files:
To apply changes, use the chevron buttons and .
To append changes, press Ctrl — the buttons will turn into .
Productivity tips
- Assign shortcuts for 'apply' and 'append'
To assign shortcuts to the apply and append actions, open the Keymap page of the IDE settings Ctrl+Alt+S and locate these actions under Version Control Systems | Diff & Merge.
- Swap sides
When you are comparing two files, or a file with the Cliboard contents, you can swap sides by clicking on the toolbar.
Compare folders
RubyMine lets you compare files in two folders against their file size, content, or timestamp. The differences are displayed in the Differences Viewer for Folders:
The top pane lists all files in the selected folders, while the bottom pane shows the differences between two versions of the selected file (see Compare files).
note
You can also open the difference viewer without running RubyMine. Run the following command:
<path to RubyMine executable file> diff <path_1> <path_2>
wherepath_1
andpath_2
are paths to the folders you want to compare.
Compare any text sources
Apart from comparing files' or folders' contents, you can open an empty Differences Viewer and paste any text or drag files into the right and left panels to compare. This can be useful, for example, if you want to compare an application's console output with the output of the same application albeit a little modified.
Press Ctrl+Shift+A and start typing to locate the Open Blank Diff Window action.
Paste any text you want to compare in the left and right panels.
Productivity tips
- Assign a shortcut for the 'Open Blank Diff' action
On the Keymap page of the IDE settings Ctrl+Alt+S, locate this action under Version Control Systems | Diff & Merge.
- Swap sides
You can swap sides in the Diff Viewer by pressing the icon on the toolbar.