1、cd仓库目录下 2、对已追踪的文件,先清除原文件的缓存 git rm -r --cached . 3、重新提交推送生效文件 git add . git commit -m “更新忽略文件” git push