本文介绍了推送到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)

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

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



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



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

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失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 14:20