How to sync to specific folder using command line in Perforce

Aman picture Aman · Jun 21, 2016 · Viewed 27.6k times · Source

Suppose I have mapped my depot to client workspace as c:/perforce/project but now

I want to sync all the files present in c:/perforce/project/fold1/fold2 folder.

How can we do it, as the command p4 sync takes only file names and not folder.

Answer

tkosinski picture tkosinski · Jun 21, 2016

Say the depot path is //depot/project/...

From the command line, do p4 sync //depot/project/fold1/fold2/...

(the "..." tells Perforce you want that folder and everything under it).

From P4V, right-click on the folder and choose "Get Latest Revision". It will only pull in the folder and everything underneath it.