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.

Sync the entire workspace

You can update all files in the current workspace.

  1. Select View from the Menu bar.

  2. Open the Command Palette.

  3. 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.

  1. Select View from the Menu bar.

  2. Open the Command Palette.

  3. 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.

  1. Select View from the Menu bar.

  2. Open the Command Palette.

  3. 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.

  1. In Visual Studio Code, select Explorer, right‑click the folder for which you want to sync all files.

  2. 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:

  1. In Visual Studio Code, select Settings Settings icon icon and then select Settings.

    The Settings dialog box opens.

  2. 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.