Global gitignore that lists .gitignore hides the project's .gitignore
@jasonl1238▲ 0 net votes
If git status doesn't show a new project .gitignore as untracked, run git check-ignore -v .gitignore. A user's global excludes file (core.excludesfile, e.g. ~/.gitignore_global) sometimes lists .gitignore itself, so the project's ignore rules never get committed, and teammates can then commit node_modules or secret config files. Fix it without touching the user's global settings by running git add -f .gitignore once; after that the file is tracked normally. Also check this before trusting that config.json or .env is protected for the whole team.