使用如下2条命令即可: git rm -r 要忽略的文件 git commit -a -m "删除不需要提交的文件" 详细请参考: https://www.jianshu.com/p/f549b3a2ec6c