I have a developer that's works with me and randomly his files get changed to CRLF line endings.
In github for windows it shows the correct change before commit, and when committed the line endings get changed and it shows a bad diff.
This only happens randomly, but cant figure out why it is changing.
Drop to the command line instead of using Github for windows. MSysGit will follow more closely what is implemented for git by the maintainers of the main git source code.
git config --system core.autocrlf false
git config --system core.whitespace cr-at-eol
Don't let your version control system mess with your line endings unless it absolutely has to.
As mentioned in "Android line breaks and git":
- check if
core.autocrlf
is set to false (see "Definitive recommendation for git autocrlf settings")
- check (and this wouldn't have anything to do with GitHub for Windows) if your repo doesn't contain
.gitattributes
files with eol
directives in them which would impose, for a certain file extension, a particular eol style.
v1.0.7 takes care of this. Here's a nice article.