问题
Is there a way to remove files/directories from Perforce's control without deleting the file from the client workspace?
I'm indifferent about what happens to the files/dirs in the repository, I want to ensure that they ARE NOT removed from my local workspace.
Thanks.
回答1:
Try
p4 delete -k <file>
It will update the server, but not touch the workspace.
http://www.perforce.com/perforce/doc.current/manuals/cmdref/delete.html
回答2:
If you're not connected to a server that supports the -k switch on the delete command, you can create a new workspace that has a different root, delete the files from there, then switch back to your original workspace. Because the new workspace has a different root, the files in your original workspace won't be touched.
回答3:
You can shelve the files and then delete the "shelved files" in perforce, your local files should be intact.
来源:https://stackoverflow.com/questions/9773766/remove-a-file-from-perforce-control-without-deleting-from-workspace