Search code examples
visual-studio-code

Can I share VSCode settings without committing settings.json to my repository?


Several VSCode settings make sense for everyone on my team to have. However, VSCode automatically edits settings.json to add to the file.associations object. Those edits contribute to diff noise and unintentional sharing when settings.json is tracked. Is there another file I can commit to my repo to share settings that VSCode will not automatically edit?

This seems to be the same question, but the accepted answer seems cumbersome. I hope there is some 2nd file that VSCode will include and overlay over settings.json OR there is a way to put another key/value pair in settings.json that will force VSCode not to modify settings.json but instead modify a local settings file.


Solution

  • This is intentionally not supported due to obvious security issues. You need to install extensions that can do it for you, save/load and synch settings.

    For example, the "Workspace Shared Settings" extension seems to do exactly what you need. There are many similar extensions.

    I simply check in the complete settings.json into the repos. Other users can pick what they need. I keep it commented and well structured. Primitive manual solution but it works.