p4 unlock
Synopsis
Release the lock on a file.
Syntax
p4 [g-opts
] unlock [-c
change
| -s
shelvedchange
| -x] [-f]
[file
...]
p4 [g-opts
] -c client unlock [-f ]
-r
p4 [g-opts
] -g -c
change
[-f ]
Description
The p4 unlock
command includes three syntax variants:
-
The first syntax variant releases locks that were created explicitly using the
p4 lock
command or implicitly during the course of a submit operation or other operations that require file locking.If the file is open in a pending changelist other than
default
, you must use the-c
option to specify the pending changelist. If no changelist is specified,p4 unlock
unlocks files in the default changelist.If no file name is given, all files in the designated changelist are unlocked.
-
The second syntax variant allows you to unlock files that were left locked due to a failed
p4 push
command.If a
p4 push
command from a remote server to this server fails, files can be left locked on this server, preventing other users from submitting changes that affect these files. In this case, the user who issued thep4 push
command can use the-r
option of thep4 push
command (and specify the name of the client that was used on that remote server) to unlock the files on this server. An administrator can runp4 unlock -f -r
as well. For example:$ p4 -p central -c myworkspace unlock -r
- In an edge/commit architecture, this syntax variant unlocks the files
in the specified changelist locally and globally. This option may
only be used from an edge server containing the local change, and it
must be used with the
-c changelist
option.
By default, files can be unlocked only by the changelist owner who must
also be the user who has the files locked. However, administrators may
use the -f
option to forcibly unlock a file opened by another user.
For example, you can run a command like the following on the commit
server.
$ p4 -c myclient unlock -xf myfile
An admin may also use this syntax to forcibly unlock files of type +1, which are not marked as orphaned, but which can no longer be unlocked by the user who opened them.
Options
|
Unlock files in pending changelist |
|
Superuser or administrator force option; allows unlocking of files opened by other users. You may now use a command like to following to unlock files of type =1 |
|
Unlock the files associated with the specified client that were locked
due to a failed |
|
If a file is locked in a pending shelved changelist, unlock it and
keep it within the |
|
In distributed environments, unlock files that have the |
|
See “Global Options”. |
Usage Notes
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
No |
No |
|