I have been bitten by the Windows/Linux line-ending issue with git. It seems, via GitHub, MSysGit, and other sources, that the best solution is to have your local repos set
Follow these steps if none of other answers works for you:
git config --global core.autocrlf true
; if you are on Unix, do git config core.autocrlf input
git rm --cached -r .
.gitattributes
git add -A
git reset --hard
Then your local should be clean now.
Here's how I fixed all line endings in the entire history using git filter-branch
. The ^M
character needs to be entered using CTRL-V
+ CTRL-M
. I used dos2unix
to convert the files since this automatically skips binary files.
$ git filter-branch --tree-filter 'grep -IUrl "^M" | xargs -I {} dos2unix "{}"'