Use labels
Labels can be used to mark important file revisions, such as the set of file revisions used to build a particular software release. You can use labels to specify groups of related file revisions when you get file revisions (sync), compare file revisions (diff), and integrate (merge, copy, and branch).
To use labels, you first define the label and then apply the label to file revisions in the depot.
Create and edit labels
To create and edit labels, use
P4V or p4, the
P4 Server
command-line client. See
P4 Visual Client (P4V) Documentation or P4 CLI Documentation.
Label files
To apply labels to files, use P4V or p4, the
P4 Server
command-line client. See
P4 Visual Client (P4V) Documentation or P4 CLI Documentation.
Display and search for labels
To display the labels defined for the P4 Server depot to which you are connected in P4 for Visual Studio:
- Go to View > Labels to open the Labels tool window.
-
To search for labels, use the filter fields.
You can filter by any combination of the following:
- Owner
- Label name
-
File path
Use standard P4 Server syntax (
//depot/folder/folder/filenameor//depot/folder/…). To learn more, see the P4 CLI Documentation.
To change the order in which columns are displayed, drag the column headings right or left to the desired position. To sort by column, click the sort arrow on a column heading.
- To view details about a label, such as the owner, description, and view, select the label row and click Details in the lower pane.
- To view a list of files in a label, select the label row and click Files in the lower pane.
Retrieve files by label
To retrieve a file revision in a label:
- Right-click the file in Solution Explorer and select Revisions > Get Revision.
- Select Specify revision using: Label and browse for the label.
- (Optional) Select Remove files from workspace if they are not in label to ensure that your workspace contains only the labeled file revisions.