Add files

Add new files to your workspace and manage how files are marked for add.

Add a new file

Marking a file for add stages it to be added to the depot the next time you submit the changelist.

  1. In Visual Studio Code, select Explorer, and right‑click the new file.

  2. Select P4 > Add file.

Automatically add files on creation

You can configure the extension to automatically mark new files for add when they are created in Visual Studio Code.

  1. In Visual Studio Code, select the Settings Settings icon icon and select Settings. The Settings dialog box opens.

  2. Under Extensions > P4 VS Code > P4, select P4: Add On File Create to enable.

When Add On File Create is enabled, new files are automatically marked for add.

Add multiple files

You can add multiple new files at the same time.

  1. In Visual Studio Code, select Explorer, and select multiple files. Press Ctrl or Shift and select the files.

  2. Right‑click and select P4 > Add file.

All selected files are marked for add in the pending changelist.