Github推送错误:RPC失败; 结果= 22,HTTP代码= 413

Github现在正在做一个愚蠢的问题。 我有一个体面的变化(〜120MB大小),当我试图推动,这是发生了什么事情:

error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

我已经完成了

git config http.postBuffer 524288000 ,这样似乎不是问题。 会是什么呢?

如果你得到错误413,那么问题不在于git,而在于你的web服务器 。 这是你的networking服务器阻止大量的上传文件。

解决scheme为nginx

只需加载你的nginx.conf并添加client_max_body_size 50m; (改变你的需求值)在http块。

重新加载nginx接受新的configuration通过执行sudo service nginx reload然后再次尝试通过http推送您的提交。

Apache的解决scheme

在你的httpd.conf添加LimitRequestBody 52428800 (改变你的需要的值)在一个<Directory />块。 这样做可以限制整个服务器文件系统的请求,只需要一个虚拟主机或一个目录。

我希望这有帮助。

我想到了!!! 当然我打完后就马上发!

我有回购集使用HTTPS的url,我改成了SSH地址,一切恢复正常工作。

命令来更改远程URL(从https – > git @ …)是这样的

 git remote set-url origin git@github.com:GitUserName/GitRepoName.git 

这里的起源是我的远程的名字(做混帐远程和出来的是你的起源)。

我已经在git URL中有“HTTPS //”,但仍然面临这个错误。

我所做的只是添加选项-u推,它的工作。

git push -u origin master

我有同样的问题,但我正在使用反向代理。

所以我必须设置

 client_max_body_size 50m; 

在两个configuration文件里面:

  • 在gitlab nginxnetworking服务器(如前面的答案里面所说)
  • 而且还在专用服务器上托pipe的nginx反向代理上。

对于那些使用IIS 7来托pipegit http / https端点的用户:

你需要增加你的uploadReadAheadSize

启动Internet信息服务(IIS)pipe理器

  1. 展开服务器字段

  2. 展开网站

  3. select您想要进行修改的网站。

  4. 在“function”部分中,双击“ Configuration Editor

  5. Sectionselect: system.webServer > serverRuntime

  6. 修改uploadReadAheadSize部分(该值必须介于02147483647 。)

  7. 点击应用

  8. 重新启动网站

当我试图在Linux机器上克隆一个git repo时,我遇到了这个问题。

下面的URL在windows中为我工作

 http://swamy@git.swamy.com/scm/project/swamy-main.git 

而下面的URL在Linux机器上工作,并且在URL中有https

 https://swamy@git.swamy.com/scm/project/swamy-main.git 

https的克隆的要点失败(ssh的作品,见下文):

 12:00 jean@laptop:~/tmp$ GIT_CURL_VERBOSE=1 git clone https://gist.github.com/123456.git username Initialized empty Git repository in /home/jean/tmp/username/.git/ * Couldn't find host gist.github.com in the .netrc file; using defaults * About to connect() to gist.github.com port 443 (#0) * Trying 192.30.252.142... * Connected to gist.github.com (192.30.252.142) port 443 (#0) * found 141 certificates in /etc/ssl/certs/ca-certificates.crt * server certificate verification OK * common name: *.github.com (matched) * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com * start date: Mon, 30 Apr 2012 00:00:00 GMT * expire date: Wed, 09 Jul 2014 12:00:00 GMT * issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance CA-3 * compression: NULL * cipher: ARCFOUR-128 * MAC: SHA1 > GET /123456.git/info/refs?service=git-upload-pack HTTP/1.1 User-Agent: git/1.7.1 Host: gist.github.com Accept: */* Pragma: no-cache < HTTP/1.1 301 Moved Permanently < Server: GitHub.com < Date: Fri, 01 Nov 2013 05:00:51 GMT < Content-Type: text/html < Content-Length: 178 < Location: https://gist.github.com/gist/123456.git/info/refs?service=git-upload-pack < Vary: Accept-Encoding < * Ignoring the response-body * Expire cleared * Connection #0 to host gist.github.com left intact * Issue another request to this URL: 'https://gist.github.com/gist/123456.git/info/refs?service=git-upload-pack' * Couldn't find host gist.github.com in the .netrc file; using defaults * Re-using existing connection! (#0) with host gist.github.com * Connected to gist.github.com (192.30.252.142) port 443 (#0) > GET /gist/123456.git/info/refs?service=git-upload-pack HTTP/1.1 User-Agent: git/1.7.1 Host: gist.github.com Accept: */* Pragma: no-cache < HTTP/1.1 200 OK < Server: GitHub.com < Date: Fri, 01 Nov 2013 05:00:52 GMT < Content-Type: application/x-git-upload-pack-advertisement < Transfer-Encoding: chunked < Expires: Fri, 01 Jan 1980 00:00:00 GMT < Pragma: no-cache < Cache-Control: no-cache, max-age=0, must-revalidate < Vary: Accept-Encoding < * Connection #0 to host gist.github.com left intact * Couldn't find host gist.github.com in the .netrc file; using defaults * About to connect() to gist.github.com port 443 (#0) * Trying 192.30.252.142... * connected * Connected to gist.github.com (192.30.252.142) port 443 (#0) * found 141 certificates in /etc/ssl/certs/ca-certificates.crt * SSL re-using session ID * server certificate verification OK * common name: *.github.com (matched) * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=*.github.com * start date: Mon, 30 Apr 2012 00:00:00 GMT * expire date: Wed, 09 Jul 2014 12:00:00 GMT * issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert High Assurance CA-3 * compression: NULL * cipher: ARCFOUR-128 * MAC: SHA1 > POST /123456.git/git-upload-pack HTTP/1.1 User-Agent: git/1.7.1 Host: gist.github.com Accept-Encoding: deflate, gzip Content-Type: application/x-git-upload-pack-request Accept: application/x-git-upload-pack-result Content-Length: 116 < HTTP/1.1 301 Moved Permanently < Server: GitHub.com < Date: Fri, 01 Nov 2013 05:00:53 GMT < Content-Type: text/html < Content-Length: 178 < Location: https://gist.github.com/gist/123456.git/git-upload-pack < Vary: Accept-Encoding < * Ignoring the response-body * Connection #0 to host gist.github.com left intact * Issue another request to this URL: 'https://gist.github.com/gist/123456.git/git-upload-pack' * Violate RFC 2616/10.3.2 and switch from POST to GET * Couldn't find host gist.github.com in the .netrc file; using defaults * Re-using existing connection! (#0) with host gist.github.com * Connected to gist.github.com (192.30.252.142) port 443 (#0) > GET /gist/123456.git/git-upload-pack HTTP/1.1 User-Agent: git/1.7.1 Host: gist.github.com Accept-Encoding: deflate, gzip Content-Type: application/x-git-upload-pack-request Accept: application/x-git-upload-pack-result * The requested URL returned error: 400 * Closing connection #0 error: RPC failed; result=22, HTTP code = 400 

这工作: git clone git@gist.github.com:123456.git

当我尝试将我的初始提交推送到新的BitBucket存储库时发生了此错误( 错误:RPC失败;结果= 22,HTTP代码= 413 )。 由于BitBucket回购没有主分支,我发生了错误。 如果您正在使用SourceTree ,则可以通过按下Git Flowbutton在原点上创build一个主分支。

错误发生在'libcurl',这是https上传的底层协议。 解决方法是以某种方式更新libcurl。 要获得有关错误的更多详细信息,请设置GIT_CURL_VERBOSE = 1

https://confluence.atlassian.com/pages/viewpage.action?pageId=306348908

错误的含义,按照libcurl文档:CURLE_HTTP_RETURNED_ERROR(22)

如果CURLOPT_FAILONERROR设置为TRUE,并且HTTP服务器返回> = 400的错误代码,则返回此信息。

http://curl.haxx.se/libcurl/c/libcurl-errors.html

我有相同的问题(在Win XP上),我将我的Git bin目录中的libcurl-4.dll文件更新为http://www.paehl.com/open_source/?download=curl_DLL_ONLY.7z中的SSL版本(重命名到libcurl4.dll)。; 现在一切正常。

面临同样的问题。 在我的情况下,跨多个用户访问(拉/推)相同的项目是不兼容的GIT版本。

刚刚更新了GIT版本,并更新了Android工作室设置的path,对我来说工作正常。

编辑 –

Git的Windows(1.9.5)有一些问题,更新相同可能会有所帮助。

面临同样的问题,但它通过清理git仓库解决(清理未跟踪的文件使用“git干净”)。