这超出了GitHub的文件大小限制 [英] this exceeds GitHub's file size limit

查看:91
本文介绍了这超出了GitHub的文件大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的github存储库中有一些大文件,我试图添加/提交/推送,但是push命令给出了以下错误

I had some large files in my github repository which I tried to add/commit/push but the push command gave the following error

远程:错误:文件app_dump.sql为106.67 MB;这超出了GitHub的文件大小限制100.00 MB

remote: error: File app_dump.sql is 106.67 MB; this exceeds GitHub's file size limit of 100.00 MB

因此,我从存储库中删除了大文件(app_dump.sql),然后再次添加/提交/推送.但是我认为这不是正确的做法,因为无论何时我按下它,它仍然会尝试推送大文件?

So I deleted the large file (app_dump.sql) from my repository and did again add/commit/push. But I think this was not the right thing to do, because whenever I push it will still try to push the large file?

$ git status
On branch master
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)

nothing to commit, working directory clean

所以现在每次按下时,我都会收到相同的文件大小错误.如何从git中删除文件?我尝试过

so now I get the same filesize error every time I push. How can I remove the file from git? I tried

$ git rm app_dump.sql
fatal: pathspec 'app_dump.sql' did not match any files

但是没有找到任何文件,因为我删除了它...谢谢卡尔

but this did not find any file, because I deleted it... thanks carl

推荐答案

尝试还原您所做的提交:

Try reverting the commits you made:

git reset HEAD~1

这应该撤消1个本地提交.撤消本地提交,直到包含大文件为止.删除大文件.提交更改,然后推送.

This should undo 1 local commit. Undo your local commits until before the large file was included. Delete the large file. Commit your changes then push.

这篇关于这超出了GitHub的文件大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆