With Git, how do I turn off the "LF will be replaced by CRLF" warning
You can turn off the warning with
git config --global core.safecrlf false
(This will only turn off the warning, not the function itself.)
You should use core.autocrlf input
and core.eol input
. Or just don't let git change the line endings at all with autocrlf false
and get rid of highlighting of crlfs in diffs, etc with core.whitespace cr-at-eol
.
Hope this helps
I used this way:
Save your current files in Git, so that none of your work is lost.
git add . -ugit commit -m "Saving files before refreshing line endings"
Remove every file from Git's index.
git rm --cached -r .
Rewrite the Git index to pick up all the new line endings.
git reset --hard
Add all your changed files back, and prepare them for a commit. This is your chance to inspect which files, if any, were unchanged.
git add .# It is perfectly safe to see a lot of messages here that read# "warning: CRLF will be replaced by LF in file."
Commit the changes to your repository.
git commit -m "Normalize all the line endings"