Helix Core Server User Guide (2019.2)

Add files

To add files to the depot, create the files in your workspace, then issue the p4 add command. The p4 add command opens the files for add in the default pending changelist. The files are added when you successfully submit the default pending changelist. You can open multiple files for add using a single p4 add command by using wildcards. You cannot use the Helix server ... wildcard to add files recursively.

To add files recursively, use the p4 reconcile command. See p4 reconcile in the Helix Core P4 Command Reference.

Example   Add files

Bruno has created a couple of text files that he must add to the depot. To add all the text files at once, he uses the * wildcard when he issues the p4 add command.

C:\bruno_ws\Acme\dev\docs\manuals> p4 add *.txt
//Acme/dev/docs/manuals/installnotes.txt#1 - opened for add
//Acme/dev/docs/manuals/requirements.txt#1 - opened for add

Now the files he wants to add to the depot are open in his default changelist. The files are stored in the depot when the changelist is submitted.

Example   Submit a changelist to the depot

Bruno is ready to add his files to the depot. He types p4 submit and sees the following form in a standard text editor:

Change: new
Client: bruno_ws
User:   bruno
Status: new
Description:
        <enter description here>
Type:   public
Files:
    //Acme/dev/docs/manuals/installnotes.txt   # add
    //Acme/dev/docs/manuals/requirements.txt   # add

Bruno changes the contents of the Description: field to describe his file updates. When he’s done, he saves the form and exits the editor, and the new files are added to the depot.

You must enter a description in the Description: field. You can delete lines from the Files: field. Any files deleted from this list are moved to the next default changelist, and are listed the next time you submit the default changelist.

If you are adding a file to a directory that does not exist in the depot, the depot directory is created when you successfully submit the changelist.

For details on working with changelists, see Changelist-related tasks.