Adding files to the depot

To add a file to the depot, you must open the file for add, which places the file in a changelist, and submit the changelist, which copies the file to the depot.

To add a file to the depot:

  1. In the Tree pane, click the Workspace tab.
  2. Browse to the file you want to add.

    If the file does not reside in the depot, its icon is unmarked ( p4v file ws).

  3. Right-click the file and choose Mark for Add.

    The file icon displays a red plus sign (p4v file add) indicating that it is open for add.

  4. To submit the changelist containing the open file, right-click the file and choose Submit​.

    The Pending Changelist form is displayed, listing the files in the changelist.

  5. Enter a description of the change and click Submit.

    The new file is added to the depot.

Note

If you do not see the local file in the Workspace tab, choose Search > Filter Workspace > Show Files Not In Depot.

Ignore files with P4IGNORE

You can configure your workspace to ignore certains files or folders when you add to the depot. These might be automatic backup files, build files, log files, configuration scripts, personal notes, or anything else that you might not want to add to the depot.

  1. In P4V, on the Workspace tab, select the root folder of your workspace. This is the topmost folder in the workspace tree.

  2. Right-click and select Open Command Window Here.

  3. At the command prompt, set the name of a file that will hold the rules you want about which files and folders to ignore. For example,

    p4 set P4IGNORE="c:\Users\your-folder\your-workspace-root\files-and-directories-to not-add.txt"

  4. In a text editor, create a file that matches the name you specified in Step 3, and save it in the root directory of your workspace.

  5. Add to this file the rules you want and save the file. Here is an example:

    # Do not add back-up files to the depot
    *.BAK
    # I don't need temporary files to be under source control
    *.tmp
    # Ignore any PNG files
    *.png
    # Also ignore any files in my Drafts folder
    Drafts\

    where any line that begins with # is just a comment you write for yourself.

  6. Click Add. P4V notifies you of the files it will ignore and shows the red + for the files it will add.


  7. Click OK.

  8. Click Submit.

If you want more details, see the P4IGNORE environment variable in Helix Core Command-Line (P4) Reference.