无法将大型repo从gitlab迁移到github

问题描述 投票:1回答:1

我正在尝试将私人仓库从Gitlab迁移到Github。它包含一些使用git LFS跟踪的大文件。即使在那之后,我也无法将回购推送到GitHub。回购的大小很大,因为它是操作系统的完整代码库,回购的大小约为75GB。

当我试图将它推送到GitHub时,我得到以下日志。

Uploading LFS objects: 100% (8600/8600), 5.9 GB | 0 B/s, done
Enumerating objects: 472049, done.
Counting objects: 100% (472049/472049), done.
Compressing objects: 100% (302043/302043), done.
kex protocol error: type 7 seq 16549), 1020.66 MiB | 4.88 MiB/s
kex protocol error: type 7 seq 32979), 1.99 GiB | 4.83 MiB/s
remote: fatal: pack exceeds maximum allowed size
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly

如果有任何方法可以绕过尺寸限制,请告诉我。

git github repository gitlab git-lfs
1个回答
0
投票

GitHub不允许单次推送超过2 GB以防止某些类型的DoS攻击。除非您使用GitHub导入实用程序,否则您需要逐步推送此存储库。

你可以通过运行这样的东西来做到这一点:

git rev-list --reverse --all | ruby -ne 'x ||=0; x += 1; print $_ if x % 30000 == 0;' | xargs -I{} echo git push github +{}:refs/heads/master
git push github +master
git push --mirror github

这一次推送30000次提交。一旦这些都被推送,它最后一次推送master分支以包含正确的数据,然后镜像存储库的其余部分。

© www.soinside.com 2019 - 2024. All rights reserved.