I tried committing files with CRLF-ending lines, but it failed.
I spent a whole work day on my Windows computer trying different strategies and was almost drawn to s
You almost always want autocrlf=input unless you really know what you are doing.
Some additional context below:
It should be either
core.autocrlf=trueif you like DOS ending orcore.autocrlf=inputif you prefer unix-newlines. In both cases, your Git repository will have only LF, which is the Right Thing. The only argument forcore.autocrlf=falsewas that automatic heuristic may incorrectly detect some binary as text and then your tile will be corrupted. So,core.safecrlfoption was introduced to warn a user if a irreversable change happens. In fact, there are two possibilities of irreversable changes -- mixed line-ending in text file, in this normalization is desirable, so this warning can be ignored, or (very unlikely) that Git incorrectly detected your binary file as text. Then you need to use attributes to tell Git that this file is binary.
The above paragraph was originally pulled from a thread on gmane.org, but it has since gone down.