Newer Version Available
Preview Changes Identified by Source Tracking
-
In a terminal or command window, navigate to the project directory. In this example, the
directory is named MyProject.
1cd /Users/joe/dx-projects/MyProject -
To see what’s changed between your project and org, run either the project deploy preview or project
retrieve preview command. Include the --target-org flag to specify the username or alias of the scratch org or sandbox
that you want to compare with your local project. In this example, the command displays the
local changes that can be deployed to the sandbox with the alias DevSandbox.
1sf project deploy preview --target-org DevSandboxSimilarly, this example displays the remote changes in the sandbox that can be retrieved back into the local project.
1sf project retrieve preview --target-org DevSandboxThe project deploy preview command accepts the --metadata, --source-dir, and --manifest flags, which you can use to preview more granular deployments. This example previews a deployment of only ApexClass metadata:
1sf project deploy preview --metadata ApexClass --target-org DevSandbox
This project deploy preview sample output shows that there are local changes to the WidgetClass Apex class and WidgetObject__c custom object that can be deployed to the org.
1sf project deploy preview --target-org DevSandbox
2
3No conflicts found.
4
5No files will be deleted.
6
7Will Deploy [2] files.
8 Type Fullname Path
9 ──────────── ─────────────── ──────────────────────────────────────────────────────────────────────────────
10 ApexClass WidgetClass force-app/main/default/classes/WidgetClass.cls-meta.xml
11 CustomObject WidgetObject__c force-app/main/default/objects/WidgetObject__c/WidgetObject__c.object-meta.xml
12
13No files were ignored. Update your .forceignore file if you want to ignore certain files.This project retrieve preview sample output shows that there are remote changes to the GizmoClass Apex class and GizmoObject__c custom object (and its layout) that can be retrieved from the org to the local project. The output also shows that there are no conflicts between the project and org.
1sf project retrieve preview --target-org DevSandbox
2
3No conflicts found.
4
5No files will be deleted.
6
7Will Retrieve [3] files.
8 Type Fullname Path
9 ──────────── ───────────────────────────────── ────
10 Layout GizmoObject__c-GizmoObject Layout
11 CustomObject GizmoObject__c
12 ApexClass GizmoClass
13
14Ignored [2] files. These files won't retrieve because they're ignored by your .forceignore file.
15 Type Fullname Path
16 ─────── ─────────────────────────────────── ────
17 Profile Admin
18 Profile B2B Reordering Portal Buyer ProfileThe preview commands use tables of change information with three columns: Type, Fullname, and Path. Each row represents one change.
- Type is the changed component’s metadata type. It describes what the component is, such as an Apex class or a custom object.
- Fullname is the API name of the component.
- Path is the location of the component in your local project. If it’s blank, the component isn’t present in your local project. When blank, it usually means that a component is present in the org but not in your local project.
If source tracking doesn’t detect any changes, then the preview commands return a statement saying No results found.
1=== Source Status
2No results foundAfter previewing the changes in the source in your local project and the org, you’re ready to deploy or retrieve and resolve potential conflicts.