Recurring file-level tasks

This section describes tasks you perform during the lifetime of your installation that occur at the file level.

Before we look at the tasks in detail, here’s a table that provides a snapshot of the sequence in which you perform the most common file-related tasks.

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

Here are the basic steps for working with files. In general, to change files in the depot (file repository), you open the files in changelists and submit the changelists with a description of your changes. Helix Server assigns numbers to changelists and maintains the revision history of your files. This approach enables you to group related changes and find out who changed a file and why and when it was changed.

Task Description

Syncing (retrieving files from the depot)

Issue the p4 sync command, specifying the files and directories you want to retrieve from the depot. You can only sync files that are mapped in your client workspace view.

Add files to the depot

  1. Create the file in the workspace.
  2. Open the file for add in a changelist (p4 add).
  3. Submit the changelist (p4 submit).

Edit files and check in changes

  1. If necessary, sync the desired file revision to your workspace (p4 sync).
  2. Open the file for edit in a changelist (p4 edit).
  3. Make your changes.
  4. Submit the changelist (p4 submit). To discard changes, issue the p4 revert command.

Delete files from the depot

  1. Open the file for delete in a changelist (p4 delete). The file is deleted from your workspace.
  2. Submit the changelist (p4 submit). The file is deleted from the depot.

Discard changes

Revert the files or the changelist in which the files are open. Reverting has the following effects on open files:

Add

no effect - the file remains in your workspace.

Edit

the revision you opened is resynced from the depot, overwriting any changes you made to the file in your workspace.

Delete

the file is resynced to your workspace.

Files are added to, deleted from, or updated in the depot only when you successfully submit the pending changelist in which the files are open. A changelist can contain a mixture of files open for add, edit and delete.

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

Also in this section: