p4 sync (graph)
Synchronize the client workspace with its view of the repo.
Syntax
p4 sync [-f -n -q -k] [--parallel=threads=N[,batch=N]] [file[commit-sha1 | reference] ...]
Description
Sync updates the client workspace to reflect the current contents of the repo (if it has changed).
If a filepath is specified and it matches paths that exist in one or more repos mapped to the client, those repos will be synced. For example,
- If both repo1 and repo2 have a branch named dev,
- the command p4 sync -f dev will sync the dev branch in both repos
- the command p4 sync -f //repo/repo1/...@dev will sync the dev branch in repo1 and will not sync the dev branch from repo2
-
If only repo1 has a branch named dev,
- the command p4 sync -f dev will sync the dev branch in repo1
- the command p4 sync -f //repo/repo1/...@dev will sync the dev branch in repo1
- By default, the entire portion of the repo that is mapped to the client will be synced, not just the files in the specified filepath. If a sha or reference is specified, the client will be syned to that commit.
- If a branch reference is specified, the branch with which the client is currently associated will also be updated.
If the client has open files in the specified repo, syncing will only be permitted if the commit that is to be synced is a child of the current commit (a fast-forward).
Sync adds files that have not been retrieved before, deletes previously retrieved files that have been deleted from the repo, and updates files that have been updated in the repo.
Normally, sync does not overwrite workspace files that the user has manually made writable. Setting the clobber
option in the client specification disables this safety check.
You can sync a client that has a view spec that maps files in a repo. If
you do not specify a branch in the repo, p4 sync
defaults to the master
branch of the repo. If the client
spec maps both a classic depot and a depot of type graph
,
p4 sync
updates the client workspace for both types
of depots. To sync a repo branch or a SHA-1, see the
Examples.
For more information about depots of type graph
, see:
- Including Graph Depot repos in your client
in
p4 client
- Working with depots of type graph
in
p4 depot
- Stream and graph depot - .git suffix and repo path in p4 stream
Options
|
Force the sync. Helix Core Server performs the sync even if the client workspace already has the file at the specified revision. If the file is writable, it is overwritten. This option does not affect open files, but it does
override the |
|
Updates server metadata without syncing files. This enables you to ensure that the server reflects the state of files in the workspace while avoiding a large data transfer. Warning
An erroneous update can cause the server to incorrectly reflect the state of the workspace. |
|
Preview mode: Display the results of the sync without actually performing the sync. |
|
Quiet operation: suppress normal output messages. Messages describing errors or exceptional conditions are not suppressed. |
|
Specify options for parallel file transfer. The configurable
See Parallel processing in p4 sync. |
Usage Notes
Working with a depot of type graph
Examples
|
For a repo in a depot of type |
|
For a repo in a depot of type |
|
For a repo in a depot of type |