I ran a global configuration command in git to exclude certain files using a .gitignore_global file:
git config --global core.excludesfile ~/.gitignore_globa
Open config file to edit :
git config --global --edit
Press Insert and remove the setting
and finally type :wq and Enter to save.
:wq