Git core.safecrlf different behavior on files with same line endings

前端 未结 2 1076
失恋的感觉
失恋的感觉 2021-01-31 06:26

I have Windows machine with VS project and I use both Visual Studio and tools from Cygwin environment including Git. Sometimes I get different line endings in files after editin

2条回答
  •  -上瘾入骨i
    2021-01-31 06:37

    The CR LF line ending choices are not that easy to understand. There are two places for the descriptions in that it is covered both in Git-attributes and Git-config manuals.

    Initially there were the autocrlf settings, and then there were the newer versions which have some potential incompatibilities (i.e. do unexpected things as you indicate).

    I tend to set the eol=LF, which makes all text files be committed as LF line endings (you can set attributes as to which files are considered text) and then add the safecrlf for doing a round trip check.

提交回复
热议问题