昨天师弟告诉我,他手误把node_moudules上传到了Gitee上,导致远程仓库爆了
(remote: Push rejected for repository size exceeds limit.)
我和我的朋友说了这个神操作,他给出了“锐评”
本地执行命令
git rm -r --cached node_modules
git commit -m 'delete all node_modules file'
git push origin master
执行过上述命令后,我们本地仓库中上传的node_modules文件夹就被删除了,
之后我们需要在.gitignore文件中设置不再提交node_modules文件
# compiled output
/dist
/node_modules
Gitee操作
我们可以再统计页面参看当前仓库大小,因为仓库内容已经超过了1024MB才会报上面的错误,我们只需要清空悬空文件,操作如下:
文章荐读: