How do you find out which rule is ignoring a file?
Run git check-ignore -v path. It prints the file, line number and pattern of the rule that matches, which helps when a file unexpectedly does not show up in git status.
Explain it simply
You created config/local.js and git status shows nothing. Somewhere a rule is eating it, but your repo may have several gitignore files plus the global one.
git check-ignore -v config/local.js answers precisely: it shows which file, which line and which pattern matched. No output means the file is not ignored. To add an ignored file anyway use git add -f, but treat that as a last resort.
Example
git check-ignore -v config/local.js
# .gitignore:4:*.js config/local.js
git add -f config/local.jsWhat to say in the interview
"git check-ignore -v shows the exact gitignore file, line and pattern that ignores a path. It saves guessing when a file does not appear in status, and git add -f forces it in when truly needed."