One git option that I almost never see in other people configs is
[core]
autocrlf = input
safecrlf = true
It prevents commiting CRLF files and forces you to convert those to LF before commit (you can still override it with gitattributes if necessary). I hate CRLF so much that I spent lots of time digging out this combination of configuration values.
Oh that's great. I always used the following `.gitattributes`:
# Enforce `lf` for text files (even on Windows)
* text=auto eol=lf
I'll try your config too.
My current position is that anywhere you can choose between CRLF and LF (git, editor, program output), it should always be LF regardless of the platform. Simple LF just works on Windows, and removing this variation point simplifies so much of code. For example, you can check reproducible outputs or hashing with a single reference value.