3

This is an example from Override .gitattributes text=auto in Windows:

C:\python-tdl\examples\termbox>git config core.autocrlf
false

C:\python-tdl\examples\termbox>git commit termbox.py
warning: LF will be replaced by CRLF in examples/termbox/termbox.py.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in examples/termbox/termbox.py.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in examples/termbox/termbox.py.
The file will have its original line endings in your working directory.
Aborting commit due to empty commit message.

That other question asks how to override .gitattributes while I would like to know WHY the warning happens.

According to the docs, text=auto does normalization, i.e., changes CRLF -> LF on check in. It shouldn't touch the file in the other direction. In other words, it should behave similarly as if I had core.autocrlf = input.

So what's the warning about? Does Git want to change LF -> CRLF in my working directory? (Which doesn't make sense.) Or is it telling me that LF will be in the repository? (In which case the message reads just wrong, doesn't it?)

Community
  • 1
  • 1
Borek Bernard
  • 50,745
  • 59
  • 165
  • 240
  • http://stackoverflow.com/questions/5834014/lf-will-be-replaced-by-crlf-in-git-what-is-that-and-is-it-important – Jayan Feb 19 '16 at 15:55
  • Read that but it doesn't explain the warning message. – Borek Bernard Feb 19 '16 at 16:00
  • http://stackoverflow.com/questions/17628305/windows-git-warning-lf-will-be-replaced-by-crlf-is-that-warning-tail-backwar talks about specific case. (commit that are part of merge... ) – Jayan Feb 19 '16 at 16:30

0 Answers0