Skip to content
Development
Command

/reset-source-tracking

Reset source tracking for the target org — tells the CLI to forget all tracked changes so the next push/pull treats the full org as new state. Destructive on shared sandboxes. Requires explicit confirmation before executing.

From plugin
sf-skills
1.1k15 skills6 agents15 commands4 MCP
$ npx -y skills add forcedotcom/sf-skills --agent claude-code

Command definition

reset-source-tracking.md
description: Reset source tracking for the target org — tells the CLI to forget all tracked changes so the next push/pull treats the full org as new state. Destructive on shared sandboxes. Requires explicit confirmation before executing.
allowed-tools:
  - Bash
argument-hint: "[--target-org <alias>]"

**WARNING — Destructive operation.** Resetting source tracking tells the SF CLI to forget every tracked change between your local project and the org. After reset:

  • A subsequent `sf project deploy push` will treat **all** local metadata as new and deploy everything.
  • A subsequent `sf project retrieve start` will treat **all** org metadata as new and retrieve everything.
  • On a **shared sandbox**, this can trigger unintended mass deploys or retrieves that overwrite other developers' in-progress work.

Only proceed if you are on a personal scratch org or developer sandbox that you own.

Workflow

1. **Resolve the target org.** Parse `$ARGUMENTS` for `--target-org <alias>`. If not supplied, find the project's default:

   sf config get target-org --json

Extract the `value` field. If no default is set, ask the user: "Which org alias should source tracking be reset for?"

2. **Confirm the target.** Display the resolved alias clearly, e.g.: > Target org: **`myDevSandbox`** > Resetting source tracking is destructive on shared sandboxes. Type **`yes, reset source tracking for myDevSandbox`** to continue, or anything else to cancel.

Wait for the user's reply. If the response does not match `yes, reset source tracking for <alias>` (case-insensitive), print "Cancelled — no changes made." and stop.

3. **Execute the reset:**

   sf project reset tracking --target-org <alias> --json

Parse the JSON result. On success the `status` field is `0` and `result` is an empty object `{}`.

4. **Report outcome.** On success, print: > Source tracking reset for **`<alias>`**. The CLI has cleared its local tracking state.

On failure (non-zero status or an `error` key in the JSON), surface the error message verbatim so the user can diagnose.

5. **Post-reset guidance.** Recommend previewing the full diff before deploying: > Run `sf project deploy preview --target-org <alias> --json` to review everything that will be pushed to the org before you deploy.

Rules

  • Always use `--json` on `sf` commands so you can parse outcomes programmatically.
  • Do NOT skip the confirmation gate under any circumstances, even if the user says "just do it".
  • Do NOT chain the reset into an immediate deploy or retrieve without a separate user confirmation.
  • If the command fails with `SourceTrackingError` or a locked-tracking message, suggest `sf project reset tracking --no-prompt --target-org <alias> --json` as a fallback (this bypasses the CLI's own prompt when one exists), but re-confirm with the user first.
Read more
@forcedotcom
Ships withsf-skills

This repository provides Salesforce agent skills, plugins, and sample apps for building applications.

1.1k200 skills6 agents4 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.1k
Star history of forcedotcom/sf-skills on GitHub, a chart by star-history.com

Other commands on sf-skills.

discover

discover

Command

Show ranked what's-next nudges across the six-stage journey, run on-demand org feature detection, or find an uninstalled plugin…

@forcedotcom@forcedotcomInstall Command
feedback

feedback

Command

Record a quick 1-5 satisfaction rating as local usage telemetry. Manual-only — never dispatched by the model.

@forcedotcom@forcedotcomInstall Command
login

login

Command

Authenticate to a new Salesforce org via the browser (sf org login web). Optionally set the org as the project's default target.

@forcedotcom@forcedotcomInstall Command
logout

logout

Command

Sign out of one or all Salesforce orgs (sf org logout). Confirms before destructive action.

@forcedotcom@forcedotcomInstall Command
org

org

Command

Show just the connected Salesforce org details — alias, edition, API version, instance URL, username.

@forcedotcom@forcedotcomInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command