1:查看.gitignore文件是否在根目录下
2:查看指定忽略文件的路径是否正确,应该是相对于根目录路径忽略
3:要确保规则正确
可直接通过工具添加

4:如果之前已经将要忽略的文件添加了git仓库,则需要先清除缓存
git rm -r --cached .
git add .
git commit -m "Update .gitignore"
我的问题通过4解决成功
可直接通过工具添加

git rm -r --cached .
git add .
git commit -m "Update .gitignore"
我的问题通过4解决成功
4308
635
714
298

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