简体   繁体   English

将代码从 Gerrit 移动到 Github 时遇到“这超出了 GitHub 的文件大小限制 100.00 MB”错误

[英]Facing " this exceeds GitHub's file size limit of 100.00 MB" error while moving code from Gerrit to Github

I am moving all my projects from Gerrit to Git hub by following the instructions provided here .我按照此处提供的说明将所有项目从 Gerrit 移至 Git 中心。

While Pushing, I am getting below error推送时,我收到以下错误

git push <git url> --all
Counting objects: 383567, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (125080/125080), done.
Writing objects: 100% (383567/383567), 647.42 MiB | 7.05 MiB/s, done.
Total 383567 (delta 249729), reused 383559 (delta 249723)
remote: Resolving deltas: 100% (249729/249729), done.
remote: Checking connectivity: 383567, done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 213456sdfggdas123refsdaw
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File aclocal.m4 is 147.07 MB; this exceeds GitHub's file size limit of 100.00 MB

No file in the entire repository is more than 1 MB and that particular file is about 45KB.整个存储库中没有一个文件超过 1 MB,该特定文件大约为 45KB。 There are about 40 branches in that project and changes are happening very frequently.该项目大约有 40 个分支,并且变化非常频繁。

How do I overcome this problem?我如何克服这个问题? Will it work if I just install Git Large File Storage and try pushing?如果我只安装Git Large File Storage并尝试推送,它会起作用吗?

Removing the history is not an option for me删除历史记录不是我的选择

For your case, if the "aclocal.m4" file is the only one with the ".m4" extension, it should be enough with:对于您的情况,如果“aclocal.m4”文件是唯一带有“.m4”扩展名的文件,那么它应该足够了:

git filter-branch --index-filter 'git rm --cached --ignore-unmatch *.m4'
git push

The error message tells you the file in your history that is too big ( aclocal.m4 is 147.07 MB ).错误消息告诉您历史记录中的文件太大( aclocal.m4 is 147.07 MB )。

If you absolutely want to push your history on GitHub, you only have 2 options (that will modify your history):如果您绝对想在 GitHub 上推送您的历史记录,您只有 2 个选项(将修改您的历史记录):

  • You could rewrite it to remove the file if it is not needed and was committed by error.如果不需要并且错误提交,您可以重写它以删除文件。
  • Or you could indeed convert all your repository (and your history) to "Git Large File Storage" using git lfs migrate .或者您确实可以使用git lfs migrate将所有存储库(和您的历史记录)转换为“Git Large File Storage”。 Not just install it...不仅仅是安装...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM