git問題小結

1. .gitignore不起作用的原因是需要忽略的文件在緩存中。

處理方法如下:

git清除本地緩存命令如下:

git rm -r --cached .
git add .
git commit -m 'update .gitignore'

 

2. git commit 時出現了Please tell me who you are

解決方法如下:

git config --global user.email "郵箱名稱"

git config --global user.name "用戶名"

3. git bash無法識別中文的解決方法

解決方法如下:

git config --global core.quotepath false

git config --global core.pager more

參考https://www.cnblogs.com/Java-Script/p/11095468.html

4. 全局忽略文件:

A.  vi ~/.gitignore_global

B. 寫入

.DS_Store

*/.DS_Store

C. git config --global core.excludesfile ~/.gitignore_global

參考https://www.jianshu.com/p/e3d8eb2a4295

 

 

 

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