通过GIT推送大文件的问题 [英] Issues with pushing large files through GIT

查看:251
本文介绍了通过GIT推送大文件的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  remote:错误:GH001 :检测到大文件。 
remote:error:跟踪:7bbfe5c1099cfe679aa3cd1eee13e10a
remote:错误:有关更多信息,请参阅http://git.io/iEPt8g。
remote:error:文件e3384023be667de7529538b11c12ec68.201307290946.sql.gz是125.37 MB;这超过了GitHub的文件大小限制为100 MB

我已经通过并确保此文件不存在于该目录中,并已完成git add -u,我们试图修剪分支,但这不起作用,因为它找不到要删除的文件。



任何帮助我们将非常感激。

解决方案

可能您正在推进多个提交,其中一个提交包括一个大文件,另一个提交最近一次删除该文件。



在任何情况下,您都可以尝试,如修复这超出了GitHub的文件大小限制100 MBerror ,一个过滤分支(如果你知道大文件的名称/路径,你看不到)

  git filter-branch --index-filter'git rm --cached --ignore-unmatch e3384023be667或者,如果你不'',那么你可能会发现,如果你知道但是想要摆脱任何大文件(比如> 90MB),你可以使用  BFG回收清洁剂  

  bfg --strip-blobs -bigger-90M my-repo.git 

这会追踪你在你的难以捉摸的大文件回购历史记录并将其删除。

请注意,之后您必须执行 git push --force ,因为最近提交的历史记录将被修改。

如果其他人已经克隆你的回购之前,有点沟通是为了警告他们。


Currently when I try to push to a Git repo, I am getting the following error.

remote: error: GH001: Large files detected.
remote: error: Trace: 7bbfe5c1099cfe679aa3cd1eee13e10a
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File e3384023be667de7529538b11c12ec68.201307290946.sql.gz is 125.37 MB; this exceeds GitHub's file size limit of 100 MB

I have gone through and made sure that this file does not exist in the directory, and have done git add -u, we have tried to prune the branch but this doesnt work as it cant find the file to delete.

Any help would be much appreciated.

解决方案

It is possible that you are pushing several commits, one of them including a large file, and another more recent one removing that file.

In any case, you can try, as explained in "Fixing the "this exceeds GitHub’s file size limit of 100 MB" error", a filter-branch (if you know the name/path of the large file that you can't see)

git filter-branch --index-filter 'git rm --cached --ignore-unmatch e3384023be667de7529538b11c12ec68.201307290946.sql.gz' <sha1>..HEAD

Or, if you don't know but want to get rid of any large file (say > 90MB), you can use the BFG repo cleaner

bfg --strip-blobs-bigger-than 90M  my-repo.git

That will track for you that elusive large file in your repo history and remove it.
Note that you will have to do a git push --force after that, because the history of the more recent commits will have been modified.
If others already cloned your repo before, a bit of communication is in order to warn them.

这篇关于通过GIT推送大文件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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