Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 for Visual Studio Documentation | 2025.1

# Rename and move files

When you rename or move a file using the Visual Studio Rename option, P4 for Visual Studio prompts you to add the renamed or moved file to a changelist. When you do, P4 for Visual Studio automatically marks the new file name or location for add and the old file name or location for delete. When you submit the changelist, P4 Server creates an integration record that links the renamed or moved object to its deleted predecessor, preserving its history.

To rename a file:

1. In Solution Explorer, right-click the file or folder you want to rename and select Rename.

   The file name in Solution Explorer becomes writable.

2. Type the new name.

3. When you leave the edit box, P4 for Visual Studio prompts you to add the renamed file to a changelist:

4. Select a pending changelist. The description defaults to the following, but you can change it:

       \__path__\__old_filename__ to:
       \__path__\__new_filename__

5. Click Save to Changelist to save the changes.

6. If there are code references to the renamed file in your project, Visual Studio asks if you want to rename all references.

   If you click Yes, Visual Studio renames all references, and P4 for Visual Studio prompts you to add the changes to a changelist. Follow the steps listed here to complete the process of submitting those changes to the P4 Server depot.

7. Submit the changelist.

   The changelist includes Add operations for the new file name and Delete operations for the old file name.

   To learn more about submitting changelists, see Check in files and work with changelists.

To move a file from one location to another:

1. Right-click the file you want to move and drag it to the new location.
2. P4 for Visual Studio prompts you to add the moved file to a changelist.

3. Select a pending changelist. The description defaults to the following, but you can change it:

       \__path__\__old_filename__ to:
       \__path__\__new_filename_+

4. Click Save to Changelist to save the change.

5. Submit the changelist.

   The changelist includes Move/Add operations for the new file location and Move/Delete operations for the old file location.

   To learn more about submitting changelists, see Check in files and work with changelists.

   When you revert a rename or move operation in P4 for Visual Studio, Visual Studio continues to show the new file name or location despite the fact that P4 Server has reverted it to the original name or location, unless you select Update related projects when reverting moved files in the P4 for Visual Studio preferences. To learn more, see Set P4 for Visual Studio preferences.

Your search for returned results