1. 程式人生 > >git 常見報錯解決方案(初學)

git 常見報錯解決方案(初學)

1.git add 命令 warning: LF will be replaced by CRLF in readme.tet.

git add 'xxx.php'
警告提示:
warning: LF will be replaced by CRLF in readme.tet.
The file will have its original line endings in your working directory.

原因分析:是因為在windos系統中的換行符是CRLF 而 linux是LF,所以在提交的時候 會提示:LF 將被轉換成 CRLF
解決辦法:

刪除之前的檔案然後
git config --global
core.autocrlf false

2.commit -m ‘new file’ fatal: unable to auto-detect email address (got ‘xxx’)

git commit -m 'new file'

原因分析:git 沒有配置好確實 姓名和郵箱
解決辦法:

git config --global user.name "your name"
git config --global user.email "your email"

後續會繼續新增遇到的問題