7

So I have an old repo, with many files, some are CRLF, some are LF.

I want to

(1) change ALL files to LF (I have used dos2unix to convert my files, but git commit ignores those changes!) I have also set git config --global core.autocrlf to false.

(2) prohibit all future checkins that have CRLF or auto-convert them to LF.

How do I do so?

Sorry for the rant. I have read multiple posts here and I can't believe this is so counterintuitive. I have seem many configs like core.safecrlf, core.autocrlf, .gitattributes etc, but I can't believe this simple task is so complicated for people to master and error messages are so unclear.

CuriousMind
  • 15,168
  • 20
  • 82
  • 120

1 Answers1

0

Try to set following in your .gitattributes and refresh your repository:

* text eol=lf
sam
  • 2,780
  • 1
  • 17
  • 30