Hacker News new | ask | show | jobs
by Grom_PE 17 days ago
On Windows, I've mostly avoided CRLF by configuring text editors and git to use LF, and writing text files in binary mode.

The only places that still forced CRLF were batch files and clipboard.

2 comments

> I've mostly avoided CRLF by configuring text editors and git to use LF,

That has been my experience as well. I can't remember the last time I had an issue related to CRLF.

The only times I can remember having line-ending issues is using GNU's tools on Linux. Every Windows tool I can remember using accepts both CRLF and LF.
Yesterday for me was the last time. Visual studio 2026 default to crlf I think maybe and I have autoctlf in git turned off. I should probably turn that back on.
I think you want a .gitattributes file where you set the EOL of the file types you care about. And you might want to try autocrlf=input.
Thanks for this :)
does visual studio support editorconfig.org? I use end_of_line = lf for all my projects
A lot of tooling that generates or transform text-like files (e.g. XML) outputs native line endings, which in case of Windows is CRLF. Depending on what you do, it’s almost impossible to avoid that.