Easiest way to convert all files in git repo to end of LF line

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 used dos2unix to convert my files, but git commit ignores those changes!) I also set git config --global core.autocrlf to false.

(2) disallow all future checks that have CRLFs or automatically convert them to LF.

How should I do it?

Sorry for the disclosure. I have read several posts here and I cannot believe this is so controversial. I have a lot of configurations like core.safecrlf, core.autocrlf, .gitattributes, etc., but I can't believe this simple task is so hard that people get around bugs and the error messages are so obscure.

+3


source to share


1 answer


Try setting the following in your .gitattributes and update the repository:



* text eol=lf

      

+1


source







All Articles