Sync the current file between a Visual Studio Code workspace and a ServiceNow instance
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- Building applications
Identify conflicting files and merge or overwrite the changes, between the current file in your Visual Studio Code workspace and your instance.
Before you begin
Procedure
-
Click the Sync icon
from the menu on the top-right corner of the Visual Studio Code IDE.
You can also use a keyboard shortcut Control+Shift+P in Windows and Command+Shift+P in MacOS to open the command palette and choose Now: Sync Current File from the list.- If the changes occur either on the server or on the client, the extension synchronizes the file successfully without showing up any errors.
- If there are no differences between the local and server versions, then the message No changes detected appears on the bottom of the page.
- If the same file is modified both on the client and the server, then the system displays the conflicts in a Conflicting Files dialog box.
-
If a conflict list is displayed in a Conflicting Files
dialog box, check the conflicts.
- Compare the Server and Client version using the Diff window, and evaluate the changes.
- Override the Server or Client changes.
Figure 1. Conflicting Files list -
Check for the differences in the Conflicting Files list.
Figure 2. Conflicting changes display A dialog box displays the following options:- Open Diff: Check for the differences between two versions and make the necessary changes.
- Mark Resolved: Resolve the differences and sync the versions.
- Overwrite Server: Choose if you want to override the server version with the client version.
- Overwrite Local: Choose Override Local to override the local version with the server version.
-
Click Open Diff.
You can see two versions of the file with the differences highlighted.
Figure 3. Differences in client and server - Make changes to the server version from the client version and save the file.
-
Click Mark as Resolved under Conflicting
Files.
The changes are successfully synchronized upon the next synchronization. When the changes are merged successfully, the message Sync completed successfully appears at the bottom of the page.