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