我在Windows下使用Git来检查一些文件。我收到了像
这样的警告LF将被foobar中的CRLF取代
这个警告意味着什么?我能做些什么来阻止这个警告。
答案 0 :(得分:0)
这与core.autocrlf
选项有关。手册说:
core.autocrlf
Setting this variable to "true" is almost the same as setting the
text attribute to "auto" on all files except that text files are
not guaranteed to be normalized: files that contain CRLF in the
repository will not be touched. Use this setting if you want to
have CRLF line endings in your working directory even though the
repository does not have normalized line endings. This variable can
be set to input, in which case no output conversion is performed.
Git警告你,他为你改变了行终止符。
我建议为项目设置全局策略(例如“始终使用unix行结束”,反之亦然)并禁用此选项。事情有时变得混乱,并且提交差异然后包含许多额外的空白变化。
答案 1 :(得分:0)
msysgit默认系统配置为core.autocrlf = true
,表示CRLF转换为ON。
答案 2 :(得分:0)
这可能意味着您尝试添加包含LF行结尾的文件,并且您已启用core.autocrlf
。将文件转换为CR / LF行结尾,或关闭core.autocrlf
。