GilloD
GilloD

Reputation: 571

P4: How can I delete a local copy of depot files?

I have a Unity project called, lets say, testGame in my Depot. On my C:\ drive, I have the Depot sync'ed so that Depot/Workspace are the same.

However, for some reason, the local copy of testGame in the Workspace has become corrupted- Unity is missing file references, errors are stacking up. I do not have this issue on other machines where the D/W are sync'ed, this is strictly an issue local to this machine.

Revert/Rollback has not fixed this. What I'd like to do is just nuke the local Workspace copy and re-sync from the Depot. Obviously, 'Mark for Delete' is not what I want. I tried "Remove from Workspace", but it just says "c:\Perforce_IntV2\prod\dl\testGame... file(s) not opened on this client"

Just using explorer to delete this files will also cause headaches- How can I just nuke my Workspace copy from orbit?

Upvotes: 2

Views: 7291

Answers (2)

Legolas
Legolas

Reputation: 978

You can sync to version 0 (the 'version' of the files before it was there, meaning it will get removed) with you client of choice ('get revision...' in p4v, then tell it to sync revision 0; p4 sync //...#0 in the command line). You can do this on the root of your workspace, so everything that perforce knows about will be gone. Then delete in explorer whatever is left (verify that it's not some new file you forgot to add first though!)

If you really want to just nuke it all, deleting from explorer first will speed up the sync to revision 0.

Another way to nuke everything is to delete the files with explorer and delete the p4 workspace in your perforce client. You will have then to set up the workspace again though.

After any of those, just sync again and you're back to a clean workspace.

Upvotes: 4

Samwise
Samwise

Reputation: 71454

From P4V you can use "Reconcile" to figure out which files are off and put them into a changelist; once they're opened in a changelist, "revert" will put them back into the state that matches the depot.

From the command line, just run:

p4 clean

to clean up your workspace and make sure it's consistent with the depot (discarding any local changes that aren't already in a pending changelist).

Upvotes: 2

Related Questions