Step 4: Add and work with versioned files | End user

If you are working on new files that need to be version controlled, add them to the workspace you created on your computer and then submit them to P4 Server to share them with others.

Add an ignore file

It is best practice to ignore (not version) some files, such as credentials and files that are automatically created and updated by programs. One way to do this is using a p4ignore file, typically named .p4ignore or p4ignore.txt. If your administrator (or another user) added an ignore file as part of this guide, it will be added to the workspace root folder when you first sync files as part of the steps in Work with version-controlled files. If there is not an ignore file, check with your team to see if one should be created and submitted.

Add version-controlled files

  1. Add project files to the workspace root on your computer.

  2. In P4V, choose View > Workspace Tree.

    The workspace tree shows files and folders in your workspace.

  3. Click Refresh on the toolbar to see the files you added in the workspace tree.

  4. In the workspace tree, select the files or folders to add to P4 Server.

  5. On the toolbar, click Checkout to add the selected files to a default changelist.

    To submit new or changed files to the P4 Server, you use a changelist. A changelist defines a logical grouping of work across a set of files and folders. Files and folders not yet committed to the server or checked out for editing are in pending changelists. After a pending changelist is submitted to the server, it is a submitted changelist.

  6. To see your pending changelists, choose View > Pending Changelists. In the Pending tab in the right pane, you will see the default changelist. Expand the changelist to view the list of files.

  7. Select the pending changelist and click Submit on the toolbar.

  8. Enter a changelist description so you and your team can see what each person did, and which tasks are complete.

  9. Click Submit.

    The first time you submit files for a project, it might take some time to upload all of the files to your server depending on your network connection. After you submit the initial project files, future submits will only include files that were changed or added since the last submit.

    The files are uploaded and added to P4 Server and are now version controlled.

    If a typemap was created, a padlock icon is displayed next to locked files in the Workspace tab (in the left pane). Other team members cannot check out those files until you submit them or revert them.

Work with version-controlled files

To work with files that are already version controlled by P4 Server, check them out, make changes, and then submit them to the server.

  1. In P4V, to download the latest versions of files from P4 Server, select the folder or files to work with in the workspace tree and click Get Latest on the toolbar.

  2. In the workspace tree, select the files to edit.

  3. On the toolbar, click Checkout.

  4. In the Select Pending Changelist dialog box, select a changelist or select New.

  5. Click OK.

    The files are now writable and in the pending changelist. Other team members cannot check out the files.

  6. When your changes are complete and saved, select the pending changelist and click Submit on the toolbar.

  7. Enter a Changelist description and click Submit to submit the changelist.

    The changed files are uploaded to the P4 Server.

View the dashboard

The dashboard in P4V displays details about your workspace. For example, you can see if there are files you have not submitted, or see when other team members submit files so you can get them to your workspace.

To view the dashboard, choose View > Dashboard.

The dashboard is refreshed automatically every five minutes. You can refresh it manually by clicking Refresh.

Check for changes

If you accidentally changed files in your project without checking them in, have been working offline, or are working on a large project, you can check if any project files were added, deleted, or modified so that you do not lose your work.

In P4V, click the Workspace tab in the left pane. Right-click on your workspace root and click Reconcile Offline Work. If any files have changed, a Reconciled Offline Work window is displayed, and you can choose to add those files to a changelist.

Learn more

What's next

Next, learn how to perform tasks for daily use, such as managing files, working with streams, resolving files, and configuring P4V.

Go to Step 5: Learn about other common version control tasks.