I\'m new to git, and I\'ve read a lot about line endings and
how git treats them. I\'m on Windows by the way. I have made
a .gitattributes
file and set for exam
As far as I can tell, setting core.safecrlf
to false
is the only way to turn off that warning.
safecrlf
is generally not necessary if your attributes are set correctly. The point of safecrlf
is to prevent normalization in a file that is supposed to have mixed (or non-LF) line endings in the repository. It's really only useful in combination with core.autocrlf
(to make sure that its automatic guesses can't destroy anything), and if you're setting your own attributes via .gitattributes
it should be okay to turn all that off.
The short answer to your question is NO.
Because, basically, core.safecrlf setting controls "warning level":
So, you have to choose option that suits you the most.
use
$ git config core.autocrlf false
In your .gitattributes
you can:
# normalize text files to use lf
text eol=lf
# except these which we want crlf
*.txt eol=crlf