p4 rename

Synopsis

Renaming files under Perforce.

Syntax

p4 [g-opts] rename [-c change] [-f] [-k] [-n] [-t filetype] fromFile toFile

Description

The command p4 rename is an alias for p4 move.

You can rename multiple files 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

  • Files must be open for edit before they can be moved.

  • Prior to release 2009.1, moving files was 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.

Examples

p4 edit //depot/d1/...

p4 move //depot/d1/... //depot/d2/...

Moving files from d1 to d2.

p4 integ //depot/d1/... //depot/d2/...

p4 delete //depot/d1/...

p4 submit

Moving a set of files prior to 2009.1:

  • p4 integrate copies all the files in the d1 directory to the d2 directory.

  • p4 delete deletes all files in d1.

  • p4 submit sends these changes to the depot in a single changelist.

Related Commands

Moving a file

p4 move

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