PyCharm enables you to compare arbitrary files in project (including image files), selected file with the editor, or compare a file in the editor with the Clipboard contents. All comparisons are performed in the Differences viewer.
In this section:
- Comparing files
- Comparing file in the editor with the Clipboard contents
- Comparing a file with the editor contents
- Keeping the Ctrl key pressed, click two files in the Project tool window.
- On the context menu of the selection, choose
Ctrl+D.
The Differences Viewer for Files
opens, with the differences being color-highlighted.
It is enough to select a single file in the Project tool window. In this case the context menu command is
, and the Differences Viewer shows the contents of the selected file on the left pane, and the contents of the active editor tab on the right pane. , or press
-
View the differences and apply them, if necessary, using
the chevron buttons
.
Note that keeping Ctrl pressed turns the chevron buttons
to
. Click these buttons to append changes.
Keeping Shift pressed turns the chevron buttonsto
. Click this button to revert changes.
- Open the desired file in the editor.
- Right-click the editor pane and choose on the context menu.
- View and manage differences in the Differences Viewer for Files.
- Right-click the desired file in the Project tool window.
- Choose on the context menu.
- View and manage differences in the Differences Viewer for Files.