Hi, this is simple tip - but I found it very usefull on Mac machines.
How to globally switch on ignoring .DS_Strore files:
Step 1: Create global .gitignore file.
echo .DS_Store > ~/.gitignore_global
Step 2: Tell git to use it in all repositories.
git config --global core.excludesfile ~/.gitignore_global
Bonus tip: If you have already repositories which has .DS_Store commited - you can remove them by going into your project directory and removing them from git:
git rm --cached .DS_Store