Hacker News new | ask | show | jobs
by djha-skin 622 days ago
Sure, don't use autocrlf. But some _windows_ tools need crlf, like for powershell or batch build scripts. Defaulting to lf in the editor will not save you.

Don't use `auto`, full marks, but the gitattributes file is indispensable as a safety net when explicit entries are used in it.

I mean, the whole point of the file is not everyone who is working on the project has their editors set to lf. Furthermore, not every tool is okay with line endings that are not CRLF.

When used properly (sure, ideally without auto), the git attributes file as a lifesaver.

2 comments

Powershell doesn't care about line endings, and hasn't since 2006 when v2 was launched. I have never seen v1 installed but
When LF doesn’t work (e.g. in cmd), you can always use something like .editorconfig to tell editors to use CRLF, and you should keep those files as CRLF in the repo.