16

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.

Aman
  • 979
  • 3
  • 10
  • 23

1 Answers1

29

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.

tkosinski
  • 1,631
  • 13
  • 17
  • 1
    You can also do this using local or relative paths, e.g. cd to c:\perforce\project and then "p4 sync fold1/fold2/..." – Samwise Jun 21 '16 at 16:33
  • This 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. – Aman Jun 22 '16 at 04:30
  • Something 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). – tkosinski Jul 07 '17 at 21:01
  • this seems to be accepting file paths only not folder paths, I tried folder path and I get message `- no such files(s).` – Ciasto piekarz Jun 03 '20 at 17:05
  • Yes, P4 tracks things by file, so if you don't have any files in a folder you could get that message. – tkosinski Jun 03 '20 at 21:00