How can I globally ignore files?
This has been something that has plagued me for years and I’ve never sat down to properly fix it.
Instead, I’ve just added .DS_Store to .gitignore files probably over one hundred times by over.
Anyway, the git documentation mentions the existence of a variable called core.excludesFile.
If you don’t set it, and $XDG_CONFIG_HOME isn’t overridden, you can add global ignores to $HOME/.config/git/ignore.
Let’s see this in action. First we’ll make a brand new Git repository and add a .