p4 unlock

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:

By default, files can be unlocked only by the changelist owner, who must also be the user who has the files locked. However, administrators on the commit server can use the -fx option:

$ p4 -c myclient unlock -xf myfile
Note

Consider that when the administrator uses the -fx option, the administrator undoes a feature of the +1 file type described at File type modifiers. The exclusive lock for editing of the +1 file type is meant to prevent other users from being able to affect the file.

For an alternative approach to managing the files of an absent user, see the Support Knowledgebase article, "Reverting Another User's Files".

Options

-c changelist

Unlock files in pending changelist changelist. This option applies to opened files in a pending changelist that were locked by p4 lock or a failed submit operation of an unshelved changelist.

-f

Superuser or administrator force option that allows unlocking of files opened by other users.

-r

Unlock the files associated with the specified client that were locked due to a failed p4 push command.

-s shelvedchange

If a file is locked in a pending shelved changelist, unlock it and keep it within the shelvedchange. This can typically only happen if a p4 submit -e command is aborted.

-x

In distributed environments, unlock files that have the +l filetype (exclusive open) but have become orphaned (this is typically only necessary in the event of an extended network outage between an edge server and the commit server).

g-opts

See Global Options.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

No

No

write

Related Commands

To lock files so other users can’t submit them

p4 lock

To display all your open, locked files (UNIX)

p4 opened | grep "*locked*"