Sync files from graph depots
You can sync an entire graph depot or one or more repos to a client
workspace with appropriate mappings using the p4 sync
command. When syncing information from a graph depot, this command can
only take on a limited number of options.
By default, if you do not specify a branch, p4 sync
syncs the master
branch of the repo, unless the
DefaultBranch
field in the repo spec specifies a different
branch (for more information on specifying a default branch, see
Specify a default branch). You can also append the branch name to the
command to sync a different branch, as follows:
$ p4 sync branchName
In addition, you can sync:
- a Git commit associated with a SHA-1 hashkey
- a particular reference or commit of a repo
- repos associated with a specific label
- repos/files containing a Helix Core Server wildcard
Note that it is not possible to sync individual files with the
p4 sync
command. You can only gain control of
individual files if you specify them in the View
field of
the client workspace specification. Otherwise, the whole repo is synced,
even if you specify a file in the command line.
For details and examples, see p4 sync (graph) in Helix Core Command-Line (P4) Reference.
Also in this section: