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

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

相关文章: