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

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

问题描述

我是 Git 的新手,并且有一个相当大的项目,我想将其推送到 Github 上的远程存储库 (Repo B).最初的项目也在 Github 上,但来自不同的 repo (Repo A).我必须对 Repo A 中的文件进行一些更改,然后才能在 Repo B 上设置项目.我已经设置了遥控器、ssh 密钥等,但在将代码库推送到 Repo B 时遇到了问题.

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.

我总是收到以下错误:

$ 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

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

I changed the following settings in my local gitconfig

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

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

... 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

... 并运行 git gc (我看到它重新组织了包,使每个包保持在 500MB 的包大小内).这也不起作用,我遇到了同样的错误.

... 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.

我不确定 Github 的默认包大小限制是什么(如果有的话).如果有关系,该帐户是微型帐户.

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

推荐答案

packsize 限制不影响 git 协议命令(你的推送).

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

git-configpack.packSizeLimit:

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

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

执行推送时,无论大小如何,git 都会始终创建一个包!

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天全站免登陆