Previous Table of Contents Index Next
Perforce 2009.2: Command Reference



p4 shelve
Synopsis
Store files from a pending changelist in the depot, without submitting them.
Syntax
p4 shelve [files ...]
p4 shelve -i [-f | -r ]
p4 shelve -r -c changelist
p4 shelve -c changelist [-f] [file ...]
p4 shelve -d -c changelist [-f] [file ...]
Description
Shelving is the process of temporarily storing work in progress on a Perforce Server without submitting a changelist. Shelving is useful when you need to perform multiple development tasks (such as interruptions from higher-priority work, testing across multiple platforms) on the same set of files, or share files for code review before committing your work to the depot.
The p4 shelve command creates, modifies, or discards shelved files in a pending changelist. Shelved files persist in the depot until they are discarded (by means of p4 shelve -d) or replaced by subsequent p4 shelve commands.
After shelving files, you can revert or modify them in your client workspace, and restore the shelved versions of those files to your workspace with the p4 unshelve command.
While files are shelved, other users can unshelve the shelved files into their own workspaces, or into other client workspaces.
Files that have been shelved can also be accessed with the p4 diff, p4 diff2, p4 files, and p4 print commands, using the revision specifier @=change, where change is the pending changelist number.
If no arguments are specified, p4 shelve creates a new changelist, adds files from the user's default changelist, and (after the user completes a form similar to that used by p4 submit), shelves the specified files into the depot. If a file pattern is given, p4 shelve shelves only the files that match the pattern.
Options
Force the overwriting ofany existing shelved files in a pending changelist with the contents of their client workspace copies.
Perforce administrators can use this flag with -d to force the discarding of shelved files in a specified changelist.
Read a changelist description from standard input. Input must be in the same format used by the p4 shelve form. (When modifying an existing changelist with shelved files, this option also implies -c).
-c changelist
Only the user and client workspace that owns the pending changelist can add or modify its shelved files. (Administrators can use -f to discard files.)
Only the user and workspace that owns the pending changelist can discard its shelved files. (Administrators can use -f to discard files.)
Replace all shelved files in the changelist with the files that are opened in your workspace. (To replace the files in the changelist with files open at a specific change number, use the -c or -i options.) Only the user and workspace associated with a pending changelist can replace its shelved files.
Preview the results of the shelve operation without actually shelving the files (that is, without overwriting any existing shelved files.)
Usage Notes
Can File Arguments Use
Revision Specifier?
Related Commands


Previous Table of Contents Index Next

Perforce 2009.2: Command Reference
Copyright 1999-2009 Perforce Software.