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

 

 

 

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