.gitignore 不生效怎么办?

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

如果在cmd中需要加git commit -m ‘update .gitignore’ ,生效之后,要提交,把已经提交的需要忽略的文件删除

原文地址:https://www.cnblogs.com/sbk613/p/12172338.html