Restore workspace files to match the state of corresponding depot files.
The p4 clean
command is equivalent to the
p4 reconcile -w
command.
p4 [g-opts] clean [-e -a -d -I -m -l -n] [file ...]
The p4 clean
command takes the following actions
when finding inconsistencies between files in a user’s workspace and
corresponding depot files:
To limit the scope of p4 clean
to add, edit, or
delete, use the -a
, -e
, or -d
options. For example, using the -a
option deletes any new
files in your workspace.
By default, p4 clean
does not check files and/or
paths mentioned in the P4IGNORE
file if they have been added (rather than edited). Use the
-I
option to override this behavior and ignore the P4IGNORE
file.
To preview the set of proposed workspace reconciliation actions, use the
-n
option.
|
Added files: Find files in the workspace that have no corresponding files in the depot and delete them. |
|
Deleted files: Find those files in the depot that do not exist in your workspace and add them to the workspace. |
|
Edited files: Find files in the workspace that have been modified and restore them to the last file version that has synced from the depot. |
|
Do not perform any ignore checking; ignore any settings
specified by |
-m
|
Compare the file sync or submit time (in the depot) with the file modification time (in the workspace) to help determine whether the file has changed. Normally Helix Server uses file digests to determine whether files in the workspace differ from the head revisions of these files in the depot. This can be time consuming for large files. But when the timestamps are the same, the costly digest comparisons can be skipped. This option is only relevant if you are using clean to find changed files rather than files that were deleted or added. |
|
Display output in local file syntax with relative paths, similar
to the workspace-centric view of |
|
Preview the results of the operation without performing any action. |
file |
The files whose versions you want reconciled with their latest depot versions. If you omit this parameter, the files in your local working directory are used. |
|
See Global Options. |
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
No |
No |
|
The p4 clean
command produces output in depot
syntax. To see file names and paths in local syntax, you must use the
-l
option, or use p4
status
. Compare the output of the following
commands; one without the -l
option, and the other one
with the option.
C:\test\local\client\copy\l>p4 clean -n bar //depot/copy/l/bar#none - deleted as c:\test\local\client\copy\l\bar C:\test\local\client\copy\l>p4 clean -n -l bar //depot/copy/l/bar#none - deleted as bar
p4 clean
adjusts
the specified files in your workspace to reflect their latest state in
the depot.
An equivalent for |