I remember seeing you have some issues with CRLF and LF.
I've had the same problem many months ago but ended up not needing to
solve it because we finally didn't use git in a cross-platform
project.
In the meantime, someone recently posted what I think is probably the
best possible solution.
See the last (most recent) answer here:
http://stackoverflow.com/questions/170961