Git使用出現warning: LF will be replaced by CRLF 的完美解決辦法

Huang Rong@DESKTOP-O2VRRQO MINGW64 ~/Documents/git/testgit (master)
$ git add test.txt
warning: LF will be replaced by CRLF in test.txt.
The file will have its original line endings in your working directory

出現warning: LF will be replaced by CRLF是換行符的原因,解決辦法很簡單,一行代碼,如下配置:

$ git config --global core.autocrlf false

我們再來add一條操作試試

Huang Rong@DESKTOP-O2VRRQO MINGW64 ~/Documents/git/testgit (master)
$ touch demo.txt

Huang Rong@DESKTOP-O2VRRQO MINGW64 ~/Documents/git/testgit (master)
$ git add demo.txt


完美~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章