問題
git add .
一大串的warning

warning: in the working copy of 'App.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages.json', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/cart/cart.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/cate/cate.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/home/home.vue', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'pages/my/my.vue', LF will be replaced by CRLF the next time Git touches it
解決方案
解釋:
CR/LF是不同操作系統(tǒng)上使用的換行符:
CR(CarriageReturn回車'\r'):回到一行的開頭,ASCII代碼是13
LF(LineFeed換行'\n'):另起一行,ASCII代碼是10
1、windows用戶
Git 可以在你提交時自動地把回車(CR)和換行(LF)轉換成換行(LF),而在檢出代碼時把換行(LF)轉換成回車(CR)和換行(LF)。因為git 的 Windows 客戶端基本都會默認設置 core.autocrlf=true
git config --global core.autocrlf true
提交時轉換為LF,檢出時轉換為CR、LF

2、linux/mac用戶
Git 在檢出文件時不需要進行自動的轉換。然而當一個以回車(CR)和換行(LF)作為行結束符的文件不小心被引入時,你肯定想讓 Git 修正。 所以,你可以把 core.autocrlf 設置成 input 來告訴 Git 在提交時把回車和換行轉換成換行,檢出時不轉換:(這樣在 Windows 上的檢出文件中會保留回車和換行,而在 Mac 和 Linux 上,以及版本庫中會保留換行。)Linux 最好不要設置 core.autocrlf,因為這個配置算是為 Windows 平臺定制;
#提交時轉換為LF,檢出時不轉換文章來源:http://www.zghlxwxcb.cn/news/detail-634416.html
$ git config --global core.autocrlf input文章來源地址http://www.zghlxwxcb.cn/news/detail-634416.html
到了這里,關于warning: in the working copy of ‘App.vue‘, LF will be replaced by CRLF the next time Git touches it的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!