Depending ~ above the editor you space using, a text paper with LF wouldn"t crucial be saved with CRLF: current editors can preserve eol style. However that git config setting insists on changing those...
You are watching: Git warning lf will be replaced by crlf
Simply make certain that (as i recommend here):
git config --global core.autocrlf falseThat way, you avoid any automatic transformation, and can still specify them with a .gitattributes file and core.eol directives.
windows git "LF will be replaced by CRLF"Is this warning tail backward?
No: you are on Windows, and the git config assist page walk mention
Use this setup if you want to have CRLF heat endings in your working brochure even though the repository does not have normalized heat endings.
As described in "git replacing LF with CRLF", it need to only occur on checkout (not commit), v core.autocrlf=true.
repo / crlf->lf lf->crlf / As mentioned in XiaoPeng"s answer, that warning is the very same as:
warning: (If you examine it out/or clone to one more folder v your existing core.autocrlf configuration,) LF will certainly be replaced by CRLFThe paper will have its original line end in your (current) functioning directory.
As stated in git-for-windows/git problem 1242:
I still feel this article is confusing, the message might be expanded to encompass a much better explanation the the issue, for example: "LF will certainly be changed by CRLF in file.json ~ removing the paper and check it the end again".
Note: Git 2.19 (Sept 2018), when using core.autocrlf, the bogus "LFwill be changed by CRLF" warning is now suppressed.
As quaylar rightly comments, if over there is a switch on commit, that is to LF only.
That certain warning "LF will certainly be changed by CRLF" originates from convert.c#check_safe_crlf():
if (checksafe == SAFE_CRLF_WARN) warning("LF will certainly be changed by CRLF in %s. The record will have actually its initial line endings in your functioning directory.", path);else /* i.e. SAFE_CRLF_FAIL */ die("LF would be replaced by CRLF in %s", path);It is dubbed by convert.c#crlf_to_git(), itself dubbed by convert.c#convert_to_git(), itself called by convert.c#renormalize_buffer().
And that last renormalize_buffer() is only dubbed by merge-recursive.c#blob_unchanged().
So I suspect this conversion happens on a git commit just if said commit is part of a unify process.
Note: through Git 2.17 (Q2 2018), a code cleanup adds part explanation.
See commit 8462ff4 (13 january 2018) by Torsten Bögershausen (tboegi).(Merged by Junio C Hamano -- gitster -- in go 9bc89b1, 13 Feb 2018)
convert_to_git(): safe_crlf/checksafe becomes int conv_flags
When phone call convert_to_git(), the checksafe parameter defined whatshould occur if the EOL conversion (CRLF --> LF --> CRLF) does notroundtrip cleanly.In addition, it also defined if line endings need to be renormalized (CRLF --> LF) or retained as they are.
checksafe was an safe_crlf enum through these values:
See go 6cb0912 (04 Jun 2018) by Anthony Sottile (asottile).(Merged by Junio C Hamano -- gitster -- in walk 8063ff9, 28 Jun 2018)
YES the warning is backwards.
And in truth it shouldn"t also be a warning in the very first place. Due to the fact that all this warning is saying (but backwards unfortunately) is that the CRLF personalities in your paper with home windows line endings will certainly be changed with LF"s on commit. Which way it"s normalized come the exact same line endings provided by *nix and also MacOS.
Nothing weird is going on, this is precisely the behavior you would normally want.
This warning in it"s current form is among two things:An unfortunate pest combined through an over-cautious warning message,or A really clever plot to make you really think this through...
--Update on nine July---
Removed "It is correct and accurate" as commented by
NO. The is no talking around your files at this time with CRLF. The is instead talking around files v LF.
It should read:
warning: (If you check it out/or clone to another folder v your present core.autocrlf configuration,)LF will certainly be changed by CRLF
The file will have its initial line end in your (current) working directory.
See more: Quan Zhi Gao Shou Episode 6 Eng Sub, Quanzhi Gaoshou 2 Episode 6 English Sub
This picture should describe what the means.