Renaming files under Perforce.
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.
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 |
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:
|
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 |