【发布时间】:2018-06-30 05:30:05
【问题描述】:
虽然我执行了LF will be replaced by CRLF in git - What is that and is it important?
git config core.autocrlf true
我还是得到了
警告:LF 将被替换为 .../.vscode/taskmarks.json 中的 CRLF
如何真正解决这个问题?
【问题讨论】:
虽然我执行了LF will be replaced by CRLF in git - What is that and is it important?
git config core.autocrlf true
我还是得到了
警告:LF 将被替换为 .../.vscode/taskmarks.json 中的 CRLF
如何真正解决这个问题?
【问题讨论】:
见“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。
【讨论】: