Perforce Command Reference:   [Index] [Prev] [Next]


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 Arg Use
Revision Specifier?
Can File Arg
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:
  1. p4 integrate copies all the files in the p2 directory to the guiProj directory;
  2. p4 delete deletes everything in the p2 directory;
  3. 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 p4 delete
To submit changes to the depot p4 submit



Perforce Command Reference:   [Index] [Prev] [Next]


Copyright 1999 Perforce Software.
Contact us at [email protected]
Last updated: 09/15/99 (Manual version 99.1.cr.6)