Delete a depot

If a depot was inadvertently created or depot file content becomes obsolete, consider removing that depot and all of its content.

For local depots and a Spec depot, p4 obliterate removes the versioned files as well as all their associated metadata.

For remote depots, the files and metadata on the remote server remain because p4 obliterate removes only the local client and label records. See Remote depots and multi-server development.

  1. Remove the contents of the depot.
    • For stream depots, see the -d depotname option of the p4 depot command in Helix Core Command-Line (P4) Reference.

    • For depots that are not stream depots, remove all the files in the depot with the p4 obliterate command. Before you use p4 obliterate, see the warnings in the p4 obliterate topic of Helix Core Command-Line (P4) Reference. Consider using the report mode, which provides a preview of the files that would be permanently removed. If you are certain that you want to permanently remove the files, include the -y option of the p4 obliterate command.
  2. Specify the depot to delete:
    • For an installation with a single server, run the p4 depot -d depotname command.
    • In a multi-server environment, a commit server and one or more edge servers might each have an Unload depot. However, the content of each unload depot might be different from that of the other unload depots. Before removing any of the unload depots, check each of them to determine whether you want to preserve any of its content. If you do not want to preserve an unload depot, you can delete it, even if it is not empty. On the commit server, run p4 depot -d -f nameOfUnloadDepotToDelete