I finally setup a system wide gitignore to ignore the specific folder `tmp-max` that I use on all my repositories. I store various data in this folder: log files, stack traces, notes, etc. Here is how I did it:
$ sudo git config --system core.excludesfile /etc/gitignore
$ sudo sh -c "(echo '*~'; echo ".DS_Store"; echo "tmp-max/") > /etc/gitignore"