.gitignore and Tracked Files
You add config.local.json to .gitignore, but Git still shows changes to that file. Why?
config.local.json
.gitignore
Part of Git Essentials. Next step: Clean Build Junk, Keep Your Local Secrets
Choose one answer
Ignore rules for JSON files must go in .git/info/exclude, not in .gitignore.
.git/info/exclude
.gitignore only takes effect after it is committed and pushed to the remote.
The pattern needs a leading /, because without one .gitignore only matches files in subfolders, never in the repository root.
/
The file is already tracked, and ignore rules only apply to untracked files; untrack it with git rm --cached.
git rm --cached