Search code examples
perforceworkspacepopulate

Perforce cmd line option to populate workspace


I am new to Perforce and have some experience using ClearCase earlier. I am using a Windows XP client and trying to set up my perforce client/workspace.

The Perforce view I have has mappings of type: //depot/path/to/folder/... //my_workspace/depot/path/to/folder/... However, I have not attempted the "Get latest revision" action (in p4v) for this workspace. That means, I don't have a local copy of the folder in question.

My question is: How do I populate the workspace with contents of the folder from the command line when the folder isn't present in the workspace ? The manual for p4 sync talks about getting a certain revision when the file is present in the workspace.

In terms of ClearCase, when the config spec for a snapshot view is having loadrules too, then cleartool can be told to pick the config spec from a text file and also load the contents of the view. I am trying to achieve a similar thing for Perforce.

Thanks in advance, Parag Doke


Solution

  • Running the sync command will populate the workspace. If a file or folder isn't already present, it will be created during the sync operation.

    With no additional flags specified, p4 sync will populate your workspace with the latest contents at the time the command is started.