With a couple of little commands, you’ll be able to ignore the .DS_Store files forever from your git repositories on mac!
The following command will add the .gitignore file to the git configuration
git config --global core.excludesfile ~/.gitignore
then, the following, will add the .DS_Store to the list
echo .DS_Store >> ~/.gitignore
and voilà!


Such a small yet irritating problem.. many thanks for that.
Comment by andywww — March 29, 2010 @ 6:09 pm
great, many many thanks
Comment by Lacy — July 13, 2010 @ 5:30 pm
Sweet – thanks!
Comment by vesters — November 3, 2010 @ 9:41 am
Brand new to git and this fixed a major pain in my butt, thanks!
Comment by jyoseph — December 9, 2010 @ 7:55 am