What is the difference between a project .gitignore and a global gitignore?
The project .gitignore is committed and shared with the team. A global gitignore, set through core.excludesFile, applies to every repo on your machine and holds personal clutter like editor folders and OS files.
Explain it simply
Project rules are the shared house rules: everyone ignores node_modules and build output. Personal clutter, such as .DS_Store, .idea/ or Thumbs.db, belongs to your own habits, so it should not be in every project's file.
Create ~/.gitignore_global, list your editor and OS files, and tell Git about it with git config --global core.excludesFile. There is also .git/info/exclude, which works like a gitignore but is local to one repo and never committed.
Example
git config --global core.excludesFile ~/.gitignore_global
echo ".DS_Store" >> ~/.gitignore_global
echo ".idea/" >> ~/.gitignore_globalWhat to say in the interview
"The project .gitignore is committed for the whole team. A global one, configured via core.excludesFile, holds my personal editor and OS files across all repos, and .git/info/exclude covers local-only rules for one repo."