Line Ending issues on Windows with git

jmertic edited this page Apr 15, 2011 · 1 revision

If you follow the official instructions from github on setting up msysgit on Windows, you'll notice one rather glaring issue after you first do a checkout. Running a git status will probably have a whole bunch of files that say they have been changed but you never have touched. The problem occurs because many of the files in Sugar have mixed line endings, and msysgit by default wants to convert all of them for you.

To fix this, we need to change the line-ending setting for the repository by issuing the following command while in your repository's directory:

$ git config core.autocrlf false

You'll also need to issue this command to fix the repository so that the files that were indicated as changed will no longer be marked this way

$ git reset --hard