I'm dealing with LF/CRLF issues in a git repository and reading git's documentation to try to understand what I need to do.
One part of the documentation is confusing to me: they write here:
...many editors on Windows silently replace existing LF-style line endings with CRLF, or insert both line-ending characters when the user hits the enter key. Git can handle this by auto-converting CRLF line endings into LF when you add a file to the index, and vice versa when it checks out code onto your filesystem. You can turn on this functionality with the
core.autocrlf
setting. If you’re on a Windows machine, set it totrue
— this converts LF endings into CRLF when you check out code.
What I don't understand is: if I'm using Windows, why would I care to convert line endings from LF to CRLF? Would it be because my editor doesn't recognize LF line endings and thus shows all the code in a file as being one line? If it's that, then it seems that if I'm using an editor that does recognize such LF line endings and shows the code correctly even when the file is using LF line endings, then I wouldn't need to do the LF-to-CRLF conversion, right?