1. 打开代码所在文件 2. 依次输入 1.git rm -r --cached . //删除所有缓存 2.git add . //重新添加所有文件 3.git commit -m 'ignore something' //提交 注意有.