Pull Changes from your org
Last updated
Last updated
sfp-pro | sfp (community) | |
---|---|---|
The sfp project:pull
command retrieves source from a Salesforce org and updates your local project files. It can pull changes based on a package, domain, or specific source path. This command is useful for synchronizing your local project with the latest changes in your Salesforce org.
Source tracking is a feature in Salesforce development that keeps track of the changes made to metadata both in your local project and in the org. When source tracking is enabled, the project:pull
command can more efficiently retrieve only the changes made in the org since the last sync, rather than retrieving all metadata.
Source tracking maintains a history of changes in both your local project and the Salesforce org.
It allows sfp to determine which components have been added, modified, or deleted since the last synchronization.
This feature is automatically enabled for scratch orgs and can be enabled for non-scratch orgs that support it.
project:pull
When pulling from a source-tracked org without specifying a package, domain, or source path, the command will use source tracking to retrieve only the changes made in the org.
For non-source-tracked orgs or when a specific scope is provided (via -p
, -d
, or -s
flags), the command will retrieve all metadata within the specified scope.
Source tracking provides faster and more efficient retrieval of changes, especially in large projects.
Source tracking is not available for all org types. It's primarily used with scratch orgs and some sandbox orgs.
If source tracking is not enabled or supported, the project:pull
command will fall back to retrieving all metadata within the specified scope.
The -p
, -d
, and -s
flags are mutually exclusive. Use only one to specify the scope of the pull operation.
--ignore-conflicts
: Use this flag to override conflicts and pull changes from the org, potentially overwriting local changes.
--retrieve-path
: Specifies a custom location for the retrieved source files.
--json
: When specified, the command outputs a structured JSON object with detailed information about the pull operation.
Pull changes using source tracking (if available):
Pull changes for a specific package:
Pull changes for a specific domain:
Pull changes from a specific source path:
Pull changes and ignore conflicts:
When --json
is specified, the command outputs a JSON object with the following structure:
If an error occurs during the pull operation, the command will throw an error with details about what went wrong. Use the --json
flag to get structured error information in the output.
Flag | Description | Required |
---|---|---|
Availability
✅
❌
From
August 24
-o
, --targetusername
Username or alias of the target org
Yes
-p
, --package
Name of the package to pull
No
-d
, --domain
Name of the domain to pull
No
-s
, --source-path
Path to the local source files to pull
No
-r
, --retrieve-path
Path where the retrieved source should be placed
No
-i
, --ignore-conflicts
Ignore conflicts during pull
No
--json
Format output as JSON
No
--loglevel
Logging level
No