Hexo Git部署警告"warning: LF will be replaced by CRLF"的去除方法

Windows下在使用hexo d命令部署博客时,会出现下面这个警告:

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

这个警告的意思很直接,就是Git会把LF替换为CRLF,不过这是无关紧要的,完全可以禁用此功能,这样还可以避免这个警告信息刷屏。设置方法也很简单,在MinGW窗口中输入以下命令即可:

1
git config --global core.autocrlf false

参考资料:
Windows git “warning: LF will be replaced by CRLF”, is that warning tail backward?