Comparing Deployed Files and Folders with Their Local Versions
On this page:
- Basics
- Opening the Remote Host tool window
- Comparing a remote folder with its local version
- Comparing a remote file with its local version
- Comparing a local folder with its remote version
- Comparing a local file with its version on a server
- Comparing two folders in the Difference Viewer
- Synchronizing contents of folders
Basics
Correspondence between files and folders under the project root and their copies on a server is set through server access configuration mappings. Please note, that for the sake of simplicity any file or folder under the project root is referred to as local and any file or folder on the server is referred to as remote, even if the server is installed on your machine. For details, see Deployment. Working with Web Servers. For details, see Configuring Synchronization with a Web Server.
It is clear, that a local file or folder can be mapped to an unlimited number of remote counterparts, while each remote file or folder is mapped to one and only one file or folder respectively.
Consequently, for each remote file or folder, PyCharm unambiguously detects its local version to compare with, so you can have remote items compared with their local counterparts at any time. On the contrary, remote versions of local files or folders cannot be identified uniquely, therefore PyCharm can compare local items only with their remote versions mapped through the default server access configuration.
PyCharm provides a dedicated Differences Viewer for Folders for comparing files in remote folders and their local versions against the file size, content, or timestamp. The Differences Viewer shows the contents of the local and remote directories in the Item List, in the left and right panes respectively. The contents of the selected file are shown in the lower pane, with the differences being color-highlighted.
The remote files in the Difference Viewer have the status read-only
. This means that you cannot update them directly in the Difference Viewer.
Make all the necessary changes to the local version of the file in question and upload the updated file to the server.
Besides exploring differences, the tool also provides interface for synchronizing the contents of folders.
Opening the Remote Host tool window
Do one of the following:
- On the main menu, choose .
- On the main menu, choose . Note that the tool window can be accessed this way after you have opened it using the .
Comparing a remote folder with its local version
- Open the Remote Host tool window.
- Select the folder in question. Then choose on the main menu or Sync with local on the context menu of the selection.
- In the Differences Viewer for Folders that opens, explore the differences and synchronize the files, where applicable.
Comparing a remote file with its local version
- Open the Remote Host tool window.
- Select the file in question, and then choose Compare with local version on the context menu of the selection.
-
In the Differences Viewer for Files dialog box, that opens, explore the differences and apply them, if necessary,
using the
and
buttons. For details, see Viewing Differences Between Files.
Comparing a local folder with its remote version
This action is available only if you have a default server access configuration appointed.
- Select the folder in question in the Project tool window, and then choose on the main menu.
- In the Differences Viewer for Folders that opens, explore the differences and synchronize the files, where applicable.
Comparing a local file with its version on a server
This action is available only if you have a default server access configuration appointed.
- Select the file in question in the Project tool window, and then choose on the main menu.
-
In the Differences Viewer for Files dialog box, that opens, explore the differences and apply them, if necessary,
using the
and
buttons. For details, see Viewing Differences Between Files.
Comparing two folders in the Difference Viewer
Configure the layout of the Items List. Use the toolbar buttons to narrow down or widen the set of items to show. For example, show or hide files that are present only locally or remotely, equal files, different files, files excluded from synchronization, etc.
Specify the parameter for comparison. In the Compare by drop-down list, select one of the possible options (contents, size, or time stamp). Filter the folders' contents. To do that, type filtering string in the Filter text field, and press Enter to apply it. Using the asterisk*
wildcard to represent any number of characters is welcome.
To switch to another pair of folders to compare, update the fully qualified paths to them.
Click the Browse button 

Synchronizing contents of folders
The contents of the remote folder are always shown in the right-hand pane of the Items List, the contents of its local version are always shown in the left-hand pane.
-
For each pair of items, in the * field specifies the action to apply. Click the icon in the field until the required action is set.
-
the file will be uploaded, possibly overwriting the remote version.
-
the file will be downloaded, possibly overwriting the local version.
-
the files are treated identical with regard to the selected criterion of comparison. No action will be performed by default.
-
the files differ with regard to the selected criterion of comparison. No action will be performed by default. Explore the differences in the Differences Pane of the Difference Viewer and change the intended action by clicking the icon.
The remote files in the Difference Viewer have the status
read-only
. This means that you cannot update them directly in the Difference Viewer. Make all the necessary changes to the local version of the file in question and upload the updated file to the server. -
the file is present only locally or remotely and will be removed.
-
- Do one of the following: