How do I move a Perforce “workspace” folder?

耗尽温柔 提交于 2019-11-30 04:11:18
Ofir Attal

in the P4V application:

Open the Workspace dialog: Go to Connection>Edit Current Workspace... change "Workspace root:" to where you like

If you have not already moved the files, P4V will offer to copy them for you.

As long as you know what changelist you last synced to, you can do this without having to sync again. Here's how:

  1. Note the last changelist synced
  2. Copy/move the folder to the new location
  3. Update your workspace (either the root, or the depot mapping) to point at the new location
  4. Run p4 flush //depot/path/to/folder/...@<last_changelist>

The flush command tells the server that you have the files at the path specified, at the changelist specified. It's a synonym for p4 sync -k.

Dennis

Mike's answer is almost correct, except that the p4 sync -k is not required when moving a workspace (changing the root). P4 does not care where the root is, it only tracks the files on your machine by workspace/client name.

If you wanted to change the workspace name (which would require you to create a new workspace) and populate it with files from an already synced workspace, you would then need to run p4 sync -k to let the server know that this new workspace has these files at @changeset.

If you are using any client (ie: P4V), then you can edit workspace and change the root to the new workspace path.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!