Sync files
Syncing retrieves the latest versions of files from the P4 Server depot to your local workspace. You can sync the entire workspace, a specific folder, or individual files.
On this page:
Sync the entire workspace
You can update all files in the current workspace.
-
Select View from the Menu bar.
-
Open the Command Palette.
-
Type P4: Sync, and then press Enter.
All files in the workspace are synced to the latest revisions.
Sync the current file
You can sync the currently open file to the latest revision.
-
Select View from the Menu bar.
-
Open the Command Palette.
-
Type P4: Sync file, and select P4: Sync file - Sync the open file to the latest version.
The file is now synced to the latest revision.
Sync to a specific revision
You can sync a file to a specific changelist or revision.
-
Select View from the Menu bar.
-
Open the Command Palette.
-
Type P4: Sync file revision, and select P4: Sync file revision - Sync the open file to a specific version.
The file is synced to the specified revision.
Sync a folder from the explorer
You can sync all files in a specific folder.
-
In Visual Studio Code, select Explorer, right‑click the folder for which you want to sync all files.
-
Select P4 > Sync.
All files in the selected folder are synced.
Control sync scope
You can control the scope of sync operations by using the P4: Sync Mode configuration. To set up P4: Sync Mode configuration:
-
In Visual Studio Code, select Settings
icon and then select Settings. The Settings dialog box opens.
-
Under Extensions > P4 VS Code > P4, select P4: Sync Mode.
-
whole client (default): Syncs the entire P4 client workspace.
-
workspace only: Syncs only the files within the currently open Visual Studio Code workspace folder.
-
This configuration affects how sync commands determine which files to update.