推送到github时,Git失败 [英] Git fails when pushing commit to github

查看:218
本文介绍了推送到github时,Git失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我克隆了我在github上托管的git repo到我的笔记本电脑。我能够成功地向github推送几个提交而没有任何问题。但是,现在我得到以下错误:

 压缩对象:100%(792/792),完成。 
错误:RPC失败;结果= 22,HTTP代码= 411
写作对象:100%(1148/1148),18.79 MiB | 13.81 MiB / s,完成。
总计1148(delta 356),重用944(delta 214)

从这里开始挂起并终于必须将 CTRL + C 返回到终端。

我有同样的问题,并认为它与您试图推送的repo(编辑或特定文件的大小)的大小有关。



基本上,我能够创建新的回购协议并将其推送到github。但现有的一个将不起作用。



HTTP错误代码似乎支持我,它是一个'长度必需'错误。所以也许它太大以至于不能计算或者说最大值。谁知道。

编辑


我发现问题可能是
文件很大。我有一个更新
,即使我有
成功推动到那一点,它也不会推动。
在提交
中只有一个文件,但碰巧是1.6M



因此我添加了以下配置更改

  git config http.postBuffer 524288000 

要允许最大文件大小500M和
,那么我的推送工作。这可能是
,这就是最初
的问题,并推出了一个超过http
协议的大回购。


END EDIT



我可以使用它的方式(在我修改postBuffer之前编辑)的方法是将我的回购站点复制到一台机器上可以通过ssh执行git,并将其推送到github。然后,当您尝试从原始服务器执行推/拉时,它应该通过https工作。 (因为它比原来的推送数据量要小得多)。



希望这有助于您。


I cloned a git repo that I have hosted on github to my laptop. I was able to successfully push a couple of commits to github without problem. However, now I get the following error:

Compressing objects: 100% (792/792), done.
error: RPC failed; result=22, HTTP code = 411
Writing objects: 100% (1148/1148), 18.79 MiB | 13.81 MiB/s, done.
Total 1148 (delta 356), reused 944 (delta 214)

From here it just hangs and I finally have to CTRL + C back to the terminal.

解决方案

I had the same issue and believe that it has to do with the size of the repo (edited- or the size of a particular file) you are trying to push.

Basically I was able to create new repos and push them to github. But an existing one would not work.

The HTTP error code seems to back me up it is a 'Length Required' error. So maybe it is too large to calc or greated that the max. Who knows.

EDIT

I found that the problem may be files that are large. I had one update that would not push even though I had successful pushes up to that point. There was only one file in the commit but it happened to be 1.6M

So I added the following config change

git config http.postBuffer 524288000

To allow up to the file size 500M and then my push worked. It may have been that this was the problem initially with pushing a big repo over the http protocol.

END EDIT

the way I could get it to work (EDIT before I modified postBuffer) was to tar up my repo, copy it to a machine that can do git over ssh, and push it to github. Then when you try to do a push/pull from the original server it should work over https. (since it is a much smaller amount of data than an original push).

Hope this helps.

这篇关于推送到github时,Git失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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