Perforce 2003.1 Command Reference
<< Previous Chapter
p4 protect
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 reopen

p4 rename

Synopsis

Renaming files under Perforce.

Syntax

p4 [g-opts] integrate fromFile toFile
p4 [g-opts] delete fromFile
p4 [g-opts] submit fromFile

Description

Although Perforce doesn't have a rename command, renaming a file can be accomplished by using p4 integrate to copy fromFile into a new toFile, using p4 delete to delete fromFile, and then using p4 submit to store these file changes in the depot.

You can rename multiple files with this method by including matching wildcards in fromFile and toFile.

Usage Notes

Can File Arguments Use
Revision Specifier?

Can File Arguments Use
Revision Range?

Minimal Access Level Required

fromFile: Yes
toFile: No

No

read access for fromFile
write access for toFile

Examples

p4 integrate -c 413
//depot/p2/... //depot/guiProj/...

p4 delete -c 413 //depot/p2/...

p4 submit -c 413

Renaming a set of files, in three steps:

  • p4 integrate copies all the files in the p2 directory to the guiProj directory.
  • p4 delete deletes all files in the p2 directory.
  • p4 submit makes these changes to the depot in a single atomic changelist.

Related Commands

To copy a file and keep it under Perforce's control

p4 integrate

To delete a file from the depot

p4 delete

To submit changes to the depot

p4 submit


Perforce 2003.1 Command Reference
<< Previous Chapter
p4 protect
Table of Contents
Index
Perforce on the Web
Next Chapter >>
p4 reopen
Please send comments and questions about this manual to [email protected].
Copyright 1999-2003 Perforce Software. All rights reserved.
Last updated: 07/07/03