The problem with this settings, as illustrated by the GitHub guide is an automatic conversion is done during the checkout of the repository...
That means you do not need to open a file to trigger any change.
Is it not possible to keep autocrlf
to false, and open those Windows files in editors able to respect the return line characters?
Note (illustrated here), if you need the conversion, except for some files, you could add a .gitattributes in the parent directory, with a:
myFile -crlf
In the file you set attributes to a path (or a pattern), or unset them (with the minus sign).
The crlf
attribute is the attribute which tells if a file is affected by the core.autocrlf
options. If you unset it, Git won’t mess with the line endings in the file
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…