Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Renaming files in Perforce?

Tags:

perforce

Every time I rename a file in Perforce it actually deletes an old file and adds a new one. As a result the new file doesn't share the old's file history. Is there an easy way doing it?

like image 444
Boris Lipschitz Avatar asked Feb 04 '23 02:02

Boris Lipschitz


2 Answers

Are you using P4V? It doesn't really delete and add it, it will branch it and then delete the old file (you will see that the new file shows up with the #branch action). That way, the new file will retain the history. It's sometimes not immediately visible, but if you choose to "show branching history", you will see the full history of the file, including everything that happened prior to its renaming.

like image 148
EboMike Avatar answered Mar 02 '23 00:03

EboMike


If you are using a recent enough version of Perforce (server and client), you can use the move command to rename a file while maintaining the history more like what you expect. However, as EboMike said, as long as the integration was done, the history is there... it is just slightly less accessible.

like image 26
Caleb Huitt - cjhuitt Avatar answered Mar 02 '23 01:03

Caleb Huitt - cjhuitt