我目前正在将一个大型Git项目转移到Git-LFS,这包括重写整个仓库历史记录以创建并包含某些文件在Git-LFS中。这部分过程很顺利。
然而,我在将新仓库推送到上游远程(GitHub)时遇到了问题,因为它似乎太大了,无法一次性推送:
这似乎是比较常见的问题,有一些解决方案可供选择,包括指定每次上传提交的块。然而,我的仓库是一个镜像克隆,不支持指定refspecs:
然而,我在将新仓库推送到上游远程(GitHub)时遇到了问题,因为它似乎太大了,无法一次性推送:
PS > git push
Counting objects: 337130, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (73730/73730), done.
remote: fatal: pack exceeds maximum allowed size
fatal: sha1 file '<stdout>' write error: Broken pipe30 MiB/s
error: failed to push some refs to 'git@github.com:my-repo.git'
我尝试使用HTTPS,但结果类似:
PS > git push
Counting objects: 337130, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (73730/73730), done.
error: RPC failed; curl 55 SSL_write() returned SYSCALL, errno = 10053
fatal: The remote end hung up unexpectedly
Writing objects: 100% (337130/337130), 3.58 GiB | 388.62 MiB/s, done.
Total 337130 (delta 261838), reused 337130 (delta 261838)
fatal: The remote end hung up unexpectedly
Everything up-to-date
这似乎是比较常见的问题,有一些解决方案可供选择,包括指定每次上传提交的块。然而,我的仓库是一个镜像克隆,不支持指定refspecs:
PS > git push -u origin HEAD~5000:refs/heads/master
error: --mirror can't be combined with refspecs
你有什么想法可以将镜像存储库分块推送到远程上游?
remote.<name>.mirror
设置为false。请参阅https://www.kernel.org/pub/software/scm/git/docs/git-config.html。 - torekgit rev-list --count
查看从某个起始点可达的提交数量,以及一些截止点,例如git rev-list --count 8765432 ^2222223
将告诉您在这两个点之间有多少次提交(这里的222...
是已经推送的提交,而876...
是拟议的下一批提交)。但这只是提交的数量,而不是对象的数量,更不用说大小了。[续] - torekgit pack-objects --thin
来构建一个“测试”包并检查其大小,从而自动锁定某个限制,但我不知道如何立即做到这一点。 - torek