Trying to commit Git files but getting :: fatal: LF would be replaced by CRLF in

后端 未结 6 1498
粉色の甜心
粉色の甜心 2020-11-30 22:15

When I try to commit some changed files, I get the following error message with TortoiseGit

fatal: LF would be replaced by CRLF in

6条回答
  •  情歌与酒
    2020-11-30 23:06

    Since your repo is private, you can set git-config like this:

    git config --global core.autocrlf false

    This will solve your problem.If you have any further question, You can read the 《Pro git》:

    If you’re a Windows programmer doing a Windows-only project, then you can turn off this functionality, recording the carriage returns in the repository by setting the config value to false: $ git config --global core.autocrlf false

    But when collaborating, you should better do these below:

    1. add .gitattributes, Github help-Dealing with line endings will be helpful.
    2. git config --global core.safecrlf true
      • windows:git config --global core.autocrlf true
      • mac or linux:git config --global core.autocrlf input

    You may want to Read Git docs-git config for more info.

提交回复
热议问题