How to sync to specific folder using command line in Perforce
35,829
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.
Comments
-
Aman almost 4 years
Suppose I have mapped my depot to client workspace as
c:/perforce/project
but nowI 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.
-
Samwise almost 8 yearsYou can also do this using local or relative paths, e.g. cd to c:\perforce\project and then "p4 sync fold1/fold2/..."
-
Aman almost 8 yearsThis is what I wanted. Thanks for pointing "..." tells Perforce you want that folder and everything under it. I was missing it. Can you also tell the command for getting Workspace directory and Workspace name.
-
tkosinski almost 7 yearsSomething like "p4 sync C:/mydir/myfolder/..." will work IF that path is under your default p4 workspace setting. (Since I typically have several workspaces going, I use .p4config just to make sure I'm in the right place and syncing what I want to sync).
-
Ciasto piekarz almost 4 yearsthis seems to be accepting file paths only not folder paths, I tried folder path and I get message
- no such files(s).
-
tkosinski almost 4 yearsYes, P4 tracks things by file, so if you don't have any files in a folder you could get that message.