原因:git缓存 解决办法:进入项目根目录,依次执行如下命令,移除缓存 git rm -r –-cached . git add . git commit -m "update .gitignore" 末尾的点别忘了加