1

I know there are many questions "LF will be replaced by CRL" but I believe my question is unique as I'm attempting to force LF line-endings, even on Windows, so don't want autocrlf=true.

To force the LF I created a .gitattributes in the root of my repostory with a line:

 * text=lf

However, when I attempt to add a file now I get the "LF will be replaced by CRLF" warning. Why would it replace with CRLF given my .gitattributes? I believe my global git settings have autocrlf=true, but I thought my .gitattributes would override that.

Another proposed Answer only address .txt files (*.txt), I needed all files determined to be text by git to use LF.

MarkE
  • 204
  • 2
  • 9
  • Possible duplicate of [How do I force git to use LF instead of CR+LF under windows?](http://stackoverflow.com/questions/2517190/how-do-i-force-git-to-use-lf-instead-of-crlf-under-windows) – Whymarrh Feb 26 '16 at 20:29

1 Answers1

1

Doh! .gitattributes line should have been

* eol=lf

The warnings can be suppressed using:

git config --global core.safecrlf false
MarkE
  • 204
  • 2
  • 9