Create or edit a client workspace specification and its view
A Perforce client workspace is a set of files on a user's machine which mirror a subset of the files in the depot. This command is used to create or edit a client workspace specification; invoking this command displays a form in which the user enters the information required by Perforce to maintain the client workspace.
Although there is always a one-to-one mapping between a client workspace file and a depot file, these files need not be stored at the same relative locations, nor must they have the same names. The client view, which is specified in the p4 client forms View: field, specifies how files in the client workspace are mapped to the depot, and vice-versa.
When called without a clientname argument, p4 client will operate on the client workspace specified by the P4CLIENT environment variable or its equivalents. When called with a clientname argument, the client specification is displayed read-only.
When p4 client completes, the new or altered client workspace specification is stored within the Perforce database; the files in the client workspace are not touched. The new client view won't take affect until the next p4 sync.
Field Name | Type | Description |
---|---|---|
Client: | The client workspace name, as specified in the P4CLIENT environment variable or its equivalents. | |
Date: | The date the client workspace specification was last edited. | |
Owner: | The Perforce user name of the user who owns the client workspace. The default is the user who created the client workspace. | |
Description: | A textual description of the client workspace. The default text is Created by owner. | |
Root: | The directory on the local host from which all the files in the View: are specified relative to. | |
Options: | modtime or nomodtime; and clobber or noclobber. See the Usage Notes, below, for more details. | |
View: | Specifies the mappings between files in the client workspace and files in the depot. Please see Using Views for more information. |
Flag | Description |
-t clienttemplate | Use the values of the fields in the specified client workspace as a template for the new client workspace. This flag can't be used when editing an existing client. |
-d [-f] clientname | Delete the specified client workspace, if owned by the invoking user. The -f flag allows Perforce superusers to delete client workspaces that they don't own. |
-i | |
-o | |
-f | Allows the last modification date, which is normally read-only, to be set. Can also be used by Perforce superusers to delete or modify clients that they don't own. |
g_opts | See global options. |
The Options: field will contain two values, separated by a single space. The first option must be one of the values modtime or nomodtime; the second must be clobber or noclobber.
The [no]modtime option controls the modification time of files on the client when gotten from the depot with p4 sync or p4 revert. Setting this value to modtime leaves the modification time of files in the client as the times these files were submitted to the depot. If the value is set to nomodtime, the default, the modification date is the date and time the file was copied onto the client.
The [no]clobber option controls how p4 sync behaves when retrieving files from the depot that already exist in the client. The default, noclobber, tells p4 sync to avoid clobbering client files that aren't open in Perforce, but have otherwise been made writable by the user. If clobber is selected, these files will be overwritten.
Example Text | Behavior |
p4 client | Edit or create the client workspace specification named by the value of P4CLIENT or its equivalents |
p4 client -t joesclient | Create a new client workspace, opening the form with the field values in client workspace joesclient as defaults |
p4 client -d release1 |
Task | Command |
p4 clients | |
p4 sync | |
To open new files in the client workspace for addition to the depot | p4 add |
p4 edit | |
p4 delete | |
p4 submit |