https://stackoverflow.com/a/17628243
The best solution to tackle this issue is to Globally ignore these files from all the git repos on your system. This can be done by creating a global gitignore file like:
vi ~/.gitignore_global
Adding Rules for ignoring files like:
`
################### *.com *.class *.dll *.exe *.o *.so
############
*.7z *.dmg *.gz *.iso *.jar *.rar *.tar *.zip
###################### *.log *.sql *.sqlite
###################### .DS_Store .DS_Store? ._* .Spotlight-V100 .Trashes ehthumbs.db Thumbs.db `
Now, add this file to your global git config:
git config --global core.excludesfile ~/.gitignore_global