Is there an easy way to automatically do a git checkout on any file that only has whitespace changes? I\'m dealing with both Windows and some code generation that\'s run from Ec
This is most likely a line ending issue; Windows uses CRLF (carriage return + line feed, or \r\n
) line endings, whereas most other systems use LF (line feed, or \n
). Luckily, Git can normalize files such that they are always stored as LF in the repo, but will be checked out as CRLF on Windows. You can do this by setting core.autocrlf
to true
on Windows:
$ git config --global core.autocrlf true
and setting core.autocrlf
to input
on Mac and Linux:
$ git config --global core.autocrlf input
More info is available here (scroll down to the section titled core.autocrlf).