Global gitignore for all projects

Published on

TIL that I can configure a global gitignore file that applies to all git projects, rather than having to configure .DS_Store exclusion for each project manually. I came across this reddit post about an unknown user in a person’s GitHub project, which lead to this StackOverflow answer about a certain user sainish having user ID 123456789 (that’s interesting), and about configuring a global gitignore:

echo .DS_Store >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global