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
本文介绍了使用Git过程中常见的几个问题及其解决方案,包括如何处理.gitignore文件不起作用的情况、解决提交时提示未设置用户信息的问题以及如何配置Git使其正确显示中文路径等。此外,还提供了一种设置全局忽略文件的方法。

373

被折叠的 条评论
为什么被折叠?



