仍然得到vscode taskmarks.json的git LF警告

时间:2018-06-14 08:15:03

标签: git visual-studio-code

虽然我执行了LF will be replaced by CRLF in git - What is that and is it important?

git config core.autocrlf true

我还是

  

警告:LF将被替换为CRLF ... /。vscode / taskmarks.json

如何真正解决这个问题?

1 个答案:

答案 0 :(得分:1)

请参阅“ git replacing LF with CRLF”:

  

警告“ LF will be replaced by CRLF”表示您(拥有autocrlf=true)将在提交检出周期后丢失您的Unix风格的LF (它将由Windows-样式CRLF)。
   Git不希望您在Windows下使用Unix风格的LF

(发出警告)

确保没有* text=auto之类的.gitattributes指令。
您可以将core.safecrlf设置为false,但不能在Git 2.17 / 2.18中设置:请参见“ Trying to commit Git files but getting: fatal: LF would be replaced by CRLF in <some file in repo>”:为此,您需要Git 2.19。