Today I learned about global .gitgnore files.
According to git docs this is configured with the core.excludesfile.
To see if this is set:
git config --get core.excludesfile
If so, any pattern in that file will be globally applied. Unfortunately, I didn't check that before monkeying with things, so I have no idea if I've changed my system accidentally.
From the docs (which I finally found and read):
Patterns which a user wants Git to ignore in all situations (e.g., backup or temporary files generated by the user’s editor of choice) generally go into a file specified by
core.excludesFilein the user’s~/.gitconfig. Its default value is$XDG_CONFIG_HOME/git/ignore. If$XDG_CONFIG_HOMEis either not set or empty,$HOME/.config/git/ignoreis used instead.
On my system:
$XDG_CONFIG_HOMEis not set$HOME/.config/git/ignoredoes not exist
So I think this means that I had no previously-configured global ignore patterns? Maybe???
In any event, I've now created $HOME/.config/git/ignore and configured git to specifically use it:
git config --global core.excludesfile $HOME/.config/git/ignore
I'll find out in the coming days if new files start showing up in my various repos when I run git status. 🤷