Between commit/ignore there is third clever option: commit with .default
suffix.
For example you can add settings.json
to .gitignore
, and commit settings.json.default
, much like it is common practice (in my team) with .env
files.
I took this advice from video Commit editor settings to version control? by Mattias Petter Johansson