Edit Individual Files on Remote Hosts
Once you've set up synchronization with a remote host, you can open individual files directly from the remote host and edit them in CLion, without adding/downloading them to the local project. Note that for such files not included in a project, some CLion features are not supported.
To take advantage of debugging, refactorings, and other advanced features, consider including the files into a project; see Access Files on Web Servers for details.the file
Edit a file on a remote host
If you have set a default remote host, select Deployment | Edit Remote File from the context menu in the Project Tool Window, Version Control Tool Window, or the code editor.
Otherwise, do the following:
Open the Remote Host tool window by choosing from the main menu.
Select the required deployment server from the list. The tool window shows a tree view of files and folders under the server root. If no relevant server is available in the list, click , and in the Deployment dialog that opens configure access to the required server.
Double-click the desired file or select Edit Remote File from the context menu.
The file opens in the CLion editor, without being added or downloaded to the local project.
When you work with a remote file, a special toolbar appears at the top of the editor, showing the editing status (The file is identical to remote one or The file has been modified. Upload?).
Remote files can be distinguished from local ones by the annotation that includes the server name (in our case it is <MyServer>).
When you are done editing the file, do one of the following:
To upload the file to the remote host, click or press Shift+Alt+Q.
To compare the currently opened file with the last uploaded version, click . The files are opened in the CLion Differences viewer for files.
To discard the changes introduced to the file after the last upload, click .
Note that an individual file is not added to a project. As a result, all changes are discarded as soon as you close the file or the currently opened project unless these changes have been uploaded. To prevent losing your data, CLion displays the following dialog when you attempt to close the edited file or the entire project.