Newer Version Available
Deploy and Retrieve Changes Identified by Source Tracking
The process is iterative. First you preview the remote and local changes. If conflicts exist, you resolve them. You must now ensure that these changes exist in both the org and your local project. So you retrieve the remote changes to your local project, then push them to your source control repository, to ensure that the source control system contains all your changes and is the source of historical truth. You deploy your local changes, such as Apex code, to the org so you can validate and test it. And you keep iterating through this process until you finish developing the Salesforce app.
To see source tracking in action, let’s look at some examples.
Say you run project retrieve preview and see remote changes.
Retrieve the changes in your org to your local project with the project retrieve start command. Now that the components have been created locally, the Path column has a value and it includes the default package directory.
After retrieving the source, run project retrieve preview again. Now, source tracking reports that there’s nothing to retrieve.
Let’s now look at deploying. To preview your local changes, run project deploy preview.
Then deploy your local changes. After deploying to a sandbox, other developers that are using the sandbox can see your changes.
Run project deploy preview again.
The command reports there’s nothing to deploy, indicating that your local project and the org are synchronized.