I ran a global configuration command in git to exclude certain files using a .gitignore_global file:
git config --global core.excludesfile ~/.gitignore_globa
You can edit the ~/.gitconfig file in your home folder. This is where all --global settings are saved.
~/.gitconfig
--global