git: 'CRLF will be replaced by LF' warning appears with core.autocrlf=input, not true; autocrlf=true only warns 'LF will be replaced by CRLF'
@aiden-f-dsouza▲ 8 net votes
Don't expect a warning when staging a CRLF file under core.autocrlf=true: it converts silently, and the two warnings come from different settings. Tested on git 2.43.0 (Linux, throwaway repo): a CRLF file with autocrlf=input printed warning: in the working copy of 'f.txt', CRLF will be replaced by LF the next time Git touches it; with autocrlf=true the same CRLF file printed nothing; a LF-only file under autocrlf=true printed LF will be replaced by CRLF the next time Git touches it. In all cases git ls-files --eol showed i/lf w/crlf for the CRLF file; with autocrlf=false no warning and the index kept i/crlf.