git推送失败:RPC失败;结果= 22,HTTP代码= 411 [英] git push fails: RPC failed; result=22, HTTP code = 411

查看:161
本文介绍了git推送失败:RPC失败;结果= 22,HTTP代码= 411的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只有一个分支。几个月来,我一直在使用

  git push origin master 

提交到我的本地存储库。昨天晚上,我对本地存储库进行了一些小的修改,并试图使用相同的命令推送,结果发生了这样的错误:

 错误:RPC失败;结果= 22,HTTP代码= 411 
致命:远程终端意外挂起
致命:远程终端意外挂断
所有最新的

我搜索了一下,发现了诸如这个问题这一个,但这些问题的答案都不能解决我的问题。



大部分答案都表明分离头的问题。然而我不认为我的头是分离的。我也不认为自己在错误的分支上(因为我只有一个分支......)

我做了一些实验来弄清楚什么是错误的,这里是我得到的结果:

(1)首先是我的 git status 输出


 #分支大师
#未追踪文件:
#(使用git add< file> ;. ..包含在将要提交的内容中)

#egal.aux
#egal.blg
#egal.out
#egal.pdf
#egalcar.aux
#egalcar.blg
#egalcar.pdf
没有添加提交但未跟踪的文件存在(使用git add跟踪)
git reflog


>,我可以看到我所有的本地提交,但是远程仓库不会被更新。


$ b (3)当我输入 git branch -a ,我得到


  * master 
遥控器/ origin / master


(4)当我输入 git remote show origin 时,我得到


  *远程原点
抓取网址:http://github.com/CherryQu921/egaldoc_en
推送网址:http://github.com/CherryQu921/egaldoc_en
HEAD分支:master
远程分支:
跟踪的主人
为'git push'配置的本地参考:
主人推到主人(快速前进)


我认为最后一行输出(快进)很奇怪,但我不知道有什么问题...

解决方案

如果您尝试将大量更改推送到Git存储库HTTP或HTTPS,您可能会收到错误消息,如错误: RPC失败;结果= 22,HTTP代码= 411 。这是由Git配置默认设置引起的,它将某些HTTP操作限制为1兆字节。



要在本地存储库中更改此限制,请执行以下操作:

  git config http.postBuffer * bytes * 

其中bytes是允许的最大字节数。例如:

  git config http.postBuffer 524288000 

500MB(谢谢@恒杰)


I have only one branch. For a few months I have been using

git push origin master

to commit to my local repository. Last night after I made some minor changes to my local repository and tried to push using the same command, I got this error:

error: RPC failed; result=22, HTTP code = 411
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

I googled and found questions such as this one and this one, but none of the answers to these questions solves my problem.

Most of the answers suggest the problem of detached head. Yet I don't think my head is detached. Nor do I think I am on the wrong branch (as I only have one branch...)

I did a few experiments to figure out what's wrong, and here are the results I got:

(1) First comes my git status output

# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
# egal.aux
# egal.blg
# egal.out
# egal.pdf
# egalcar.aux
# egalcar.blg
# egalcar.pdf
nothing added to commit but untracked files present (use "git add" to track)

(2) When I type git reflog, I can see all my local commits, but the remote repository just won't get updated.

(3) When I type git branch -a, I get

* master
  remotes/origin/master

(4) When I type git remote show origin, I get

* remote origin
  Fetch URL: http://github.com/CherryQu921/egaldoc_en
  Push  URL: http://github.com/CherryQu921/egaldoc_en
  HEAD branch: master
  Remote branch:
    master tracked
  Local ref configured for 'git push':
    master pushes to master (fast-forwardable)

I think the last line of output (the "fast-forwardable") is weird, but I am not sure what is wrong...

解决方案

If you attempt to push a large set of changes to a Git repository with HTTP or HTTPS, you may get an error message such as error: RPC failed; result=22, HTTP code = 411. This is caused by a Git configuration default which limits certain HTTP operations to 1 megabyte.

To change this limit run within your local repository

git config http.postBuffer *bytes*

where bytes is the maximum number of bytes permitted. For exmaple:

git config http.postBuffer 524288000

For 500MB (thanks @Hengjie)

这篇关于git推送失败:RPC失败;结果= 22,HTTP代码= 411的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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