Git提交时提示‘The file will have its original line endings in your working directory’

折腾Hexo博客有一阵子,每次提交的时候直接Hexo d后没管,这次仔细看了提交时的输出日志,发现满屏提示

warning: LF will be replaced by CRLF in xxxxx
The file will have its original line endings in your working directory.

之前一直没在意,趁有空着手解决,原来是Git默认配置替换回车换行成统一的CRLF,我们只需要修改配置禁用该功能即可。
Gitshell中输入如下命令解决:

git config –global core.autocrlf false

使用

git config –list

命令查看Git所有配置。

你可能感兴趣的:(git)