项目场景:
执行$ git add .
问题描述:
提示:warning: LF will be replaced by CRLF in src/com/…
The file will have its original line endings in your working directory.
guixuefeng@LAPTOP-SA9RG60L MINGW32 /d/gxf/workspace/spider (master)
$ git add .
warning: LF will be replaced by CRLF in src/com/spider/UserCF.java.
The file will have its original line endings in your working directory.
解决方案:
Windows 程序员,由于编辑器的不同有的会在文件结尾回加回车或空格导致此问题。可以设置 false 取消此功能,把回车保留在版本库中:
执行:$ git config --global core.autocrlf false