How do I delete a file from the perforce depot?

Let's assume you are using P4V client.

if (file is checked out):  
  right-click. revert or submit the file, then  
  right-click. mark for delete  
else:  
  right-click. mark for delete   

The steps will be similar if you are using command line or any other version management tool


Select the file in the tree view and either right-click and select Mark for Delete, or click the icon with the red X (the 5th one from the left in my version of P4V).

This will mark the file for deletion but will not actually delete it from the depot until you submit your pending changelist.

Note that this performs a logical delete from the depot; the history of the file will still be present and you'll be able to sync to previous versions of the file. If you want to wipe it completely from the depot along with all its history, you'll need to use the p4 obliterate command which is only available to Perforce administrators.


I had the same problem trying to find the mark for delete option, turns out that you can't have the file checked out at the same time :) So I had to submit my empty file before being able to delete it.

Tags:

Perforce

P4V