function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amber Parsons 2Amber Parsons 2 

how to turn off source tracking in vscode

Hello,

Somehow I have managed to 'accidentally' turn on Local Source Tracking (but, I am not using scratch orgs).  It is creating new files every time I switch branches (I use github) and make any changes.  Is there a way this can be turned off or disabled?  Any help would be greatly appreciated!


User-added image
VinayVinay (Salesforce Developers) 
Hi Amber,

To turn off source tracking in Visual Studio Code for Salesforce, you can follow these steps:
  • Open the Command Palette in VS Code by pressing Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac).
  • Type "SFDX: Turn Off Org Development" in the search bar and select the option from the list.
  • Confirm that you want to turn off source tracking for the current org by clicking "Yes" in the pop-up window.
Alternatively, you can also turn off source tracking by modifying the sfdx-project.json file in your project directory. To do this:
  • Open the sfdx-project.json file in your project directory.
  • Locate the "sourceTracking" property and set its value to "false".
  • Save the file and close it.
After turning off source tracking, you will no longer be able to retrieve or deploy changes using the SFDX CLI or Visual Studio Code's Salesforce extensions. However, you can still use other tools such as the Salesforce CLI to manage your org's metadata.

https://github.com/microsoft/vscode/issues/47348

Please mark as Best Answer if above information was helpful.

Thanks,
Amber Parsons 2Amber Parsons 2
Hi Vinay,

Thank you for responding!  Are you saying that this is something everyone who develops for Salesforce in Visual Studio Code has to deal with?  I certainly want to be able to continue to retrieve and deploy changes through the extensions.  What am I not understanding?

Thanks!
Shuvam PatraShuvam Patra
Hi there,
In Visual Studio Code (VSCode), the setting for Salesforce DX source tracking is handled through Salesforce CLI, not directly within VSCode. If you want to disable source tracking, you'll need to do this on your Scratch Org definition file (usually "project-scratch-def.json"):
Firstof, Open your project-scratch-def.json file in VSCode.
Nextup, Set the "sourceTracking" setting to false, like so:
{
"orgName": "Your Org Name",
"edition": "Enterprise",
"features": [],
"settings": {
"orgPreferenceSettings": {
"s1DesktopEnabled": true
}
},
"sourceTracking": false
}
Then, Save your changes.
Now, when you create a new Scratch Org using this definition file, source tracking will be disabled.

Please note: Disabling source tracking may impact your ability to effectively track changes between your local source and the org, which is a key feature of Salesforce DX. Be sure to fully consider the implications of this change.