超过Github远程推送包大小 [英] Github remote push pack size exceeded

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

问题描述

我是Git的新手,并且有一个相当大的项目,我想推到Github上的远程仓库(Repo B)。原来的项目也在Github上,但是来自不同的回购(回购A)。在我可以在Repo B上设置项目之前,我必须对Repo A中的文件进行一些更改。我已经设置了远程控制,SSH密钥等,并且在将代码库推送到Repo B时遇到了一个问题。



我一直得到以下错误:

  $ git push< remote_repo_name> ; master 
输入密码'/c/ssh/.ssh/id_rsa'的密码:
计数对象:146106,完成。
使用多达4个线程的增量压缩。
压缩对象:100%(35519/35519),完成。
致命:包超出了允许的最大尺寸00 GiB | 154 KiB / s
fatal:sha1文件'< stdout>'写入错误:参数无效
错误:无法将某些参考文献推送到'git@github.com:< repo> .git

我在本地gitconfig中更改了下列设置

  git config pack.packSizeLimit 1g 
git config pack.windowMemory 1g

...并运行git gc(我看到重新组织了这些包,以便每个包都保持在1GB的包大小内)。这不起作用,我得到了上面的错误。



我试图降低每个包的大小....

  git config pack.packSizeLimit 500m 
git config pack.windowMemory 500m

...并运行git gc(我看到重新整理了这些包,以便每个包都保持在500MB的包内)。这不起作用,我跑到了同样的错误。



我不确定Github的默认打包大小限制(如果有的话)。该帐户是一个微型帐户,如果这很重要。

解决方案

packsize限制不会影响git协议命令(您的推送) / p>

From git-config
pack.packSizeLimit


一个包的最大尺寸。此设置仅在重新打包时影响打包到文件,即 即。 git://协议不受影响


执行push git时,包装无论大小!



要解决这个问题,请使用两个(或更多)推送:

  git push remoteB<一些以前在master上提交>:master 
...
git push remoteB<最后一个之前的一些提交>:master
git push remoteB master

这些推送将会有更小的包装并且会成功。

I am new to Git and have a fairly large project that I want to push to a remote repo (Repo B) on Github. The original project was on Github as well but from a different repo (Repo A). I have to make some changes to files from Repo A before I can setup the project up on Repo B. I have setup the remotes, ssh keys etc. and I run into an issue when pushing the codebase to Repo B.

I get the following error all the time:

$ git push <remote_repo_name> master
Enter passphrase for key '/c/ssh/.ssh/id_rsa':
Counting objects: 146106, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (35519/35519), done.
fatal: pack exceeds maximum allowed size00 GiB | 154 KiB/s
fatal: sha1 file '<stdout>' write error: Invalid arguments
error: failed to push some refs to 'git@github.com:<repo>.git

I changed the following settings in my local gitconfig

git config pack.packSizeLimit 1g
git config pack.windowMemory 1g

... and ran git gc (which I see reorganized the packs so that each pack stayed within the packsize of 1GB). This did not work and I get the error seen above.

I tried to lower the size of each pack as well ....

git config pack.packSizeLimit 500m
git config pack.windowMemory 500m

... and ran git gc (which I see reorganized the packs so that each pack stayed within the packsize of 500MB). This did not work either and I ran into the same error.

I am not sure of what Github's default packsize limits are (if any). The account is a micro account if that matters.

解决方案

The packsize limit does not affect git protocol commands (your push).

From git-config under pack.packSizeLimit:

The maximum size of a pack. This setting only affects packing to a file when repacking, i.e. the git:// protocol is unaffected.

When executing a push git will always create exactly one pack no matter the size!

To fix this use two (or more) pushes:

git push remoteB <some previous commit on master>:master
...
git push remoteB <some previous commit after the last one>:master
git push remoteB master

These pushes will all have smaller packs and will succeed.

这篇关于超过Github远程推送包大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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