Reputation: 1845
git config --global core.autocrlf true
git config --global core.safecrlf true
I came across this on gitimmersion.com and I'm wondering what these lines do? EDIT: I checked the documentation but I'm still not sure if I get it.
Upvotes: 1
Views: 83
Reputation: 14061
These two commands add a configuration variable to your global configuration file (rather than being repo specific).
The autocrlf will automatically convert the line ending so that they are in LF format inside your repos (plural) and will restore them to either LF or CRLF depending on which OS you are operating on.
The safecrlf will actually check that the round trip result of the two conversions, in and out of the repo, produce an identical result so that there is no accidental corruption (which could happen if you have a text file with mixed line endings within it)
Do check the manual pages for additional discussion.
Upvotes: 4