org enable tracking

Allow Salesforce CLI to track changes in your source files between your project and an org.

Enabling source tracking has no direct effect on the org, it affects only your local environment. Specifically, Salesforce CLI stores the setting in the org’s local configuration file so that source tracking operations are executed when working with the org.

This command throws an error if the org doesn’t support tracking. Examples of orgs that don’t support source tracking include Developer Edition orgs, production orgs, Partial Copy sandboxes, and Full sandboxes.

Flag Name (Long)Flag Name (Short)Description
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑target‑org‑oType: Value
Required

Username or alias of the target org. Not required if the target-org configuration variable is already set.

Enable source tracking for an org with alias “myscratch”:

Enable source tracking for an org using a username:

Enable source tracking for your default org: