wadewegner has an example .gitignore file with the below content


As part of his sfdx-simple app on GitHub.

Should this file include an entry for VSCode when using VSCode?


I typically do include .vscode in my .gitignore. That directory shouldn't be under version control.

You can also create a global .gitignore that applies across all projects, although that doesn't provide benefit for other users who clone your repo.

  • do you also usually include .db in the gitignore? – BlondeSwan Mar 7 '19 at 15:48
  • I'm not sure off the top of my head what .db is. I .gitignore most cache, settings, and support files that aren't part of the project's source as such. – David Reed Mar 7 '19 at 15:53
  • I attempted to run a test (vscode couldn't run it) while I was just playing around, and it created an apex.db file in .sfdx/tools. – BlondeSwan Mar 7 '19 at 15:57
  • 1
    Oh, yeah, you'd probably want to exclude the entire .sfdx directory. – David Reed Mar 7 '19 at 15:58
  • This is not actually correct. the .vscode folder should be included in source as it contains shared project settings. Everyone on your project should be using the same settings. We do have a bug that will be fixed soon where some machine-specific settings are written to the settings. The quick fix is to check in the settings.json then add it to the gitignore so it doesnt get updated .vscode/settings.json. – Nathan Totten Sep 30 '19 at 15:55

In general, you should not commit .sfdx or .vscode, as these files store configurations specific to the local computer's workspace. Committing these files may cause issues when migrating to a new computer or sharing between other developers. If you use another IDE, like Force.com IDE, also make sure you do not reference things like "Referenced Packages" or any other metadata cache directories.


It depends whether you want to share the settings inside the .vscode folder.

On our team, we don't put .vscode into the .gitignore file because we want to share our team's recommended settings, launch configurations, tasks and extensions between developers. If you have machine specific settings then that won't work so well.

If you only want to share some settings between developers then you can pick and choose which settings files to put into .gitignore. Recommended extensions are in .vscode/extensions.json, for example.

Whether you want to share these settings is somewhat dependent on what sort of repository it is. If it's an open source repository where everyone might want different configurations for their own workflows then maybe it's best not to check them into git. For teams where it's nice to have your configuration shared for a consistent workflow then it often works well to check them in.


The .vscode directory contains a lot of local workspace settings and many you may not wish to share. It is also specific to VS Code and won't help anyone using a different editor.

Some other settings like formatting configuration you may wish to share for consistency. One potential compromise is to use a .editorconfig file and the editorconfig VS Code extension to share some of the editor specific settings without some of the other vscode/workspace specific settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.