Sometimes an annoying bug exists when the project you're working on has windows line endings in the source.
Your OSX might want to convert it to unix line-endings. This can get very frustrating.
You can tell git to leave these files alone like so:
$ git config --global core.autocrlf input
Now, you should also clear your git's cache, otherwise the problem remains:
$ git rm --cached -r .
$ git reset --hard