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 .