美文网首页
GIT warning: LF will be replaced

GIT warning: LF will be replaced

作者: 沉默羔羊121 | 来源:发表于2018-12-18 17:25 被阅读0次

在windows下使用git命令时

yangjiabo_000@BOWEN MINGW64 /d/_ALD/CoreApi/Exchange-API-Services (develop)
$ git add .
warning: LF will be replaced by CRLF in src/main/java/com/exchange/controller/UserController.java.
The file will have its original line endings in your working directory

解决方法:

设置core.autocrlf属性
设置core.autocrlf属性为false,去除警告

【查看原有设置】

yangj_000@BOWEN MINGW64 /d/_ALD/CoreApi/Exchange-API-Services (develop)
$ git config --get core.autocrlf
true

yangj_000@BOWEN MINGW64 /d/_ALD/CoreApi/Exchange-API-Services (develop)
$ git config --global --get core.autocrlf

【设置】

yangj_000@BOWEN MINGW64 /d/_ALD/CoreApi/Exchange-API-Services (develop)
$ git config core.autocrlf false

【查看设置结果】

yangj_000@BOWEN MINGW64 /d/_ALD/CoreApi/Exchange-API-Services (develop)
$ git config --get core.autocrlf
false

参考:
配置 Git : :
https://git-scm.com/book/zh/v1/%E8%87%AA%E5%AE%9A%E4%B9%89-Git-%E9%85%8D%E7%BD%AE-Git

GitHub 第一坑:换行符自动转换:
https://github.com/cssmagic/blog/issues/22

GIT使用的一些感受和经验:
http://www.bloggern.com/ProjectItem.php?ProjectItemId=6426

相关文章

网友评论

      本文标题:GIT warning: LF will be replaced

      本文链接:https://www.haomeiwen.com/subject/jkilkqtx.html