Git 克隆存储库错误:RPC 失败;结果 = 56,HTTP 代码 = 200

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26197171/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 02:34:15  来源:igfitidea点击:

Git clone repository error: RPC failed; result=56, HTTP code = 200

gitgithubrepository

提问by pixelknight

I have been using a Git repository for a couple years and still feel like a newb.. help is most welcome!

我已经使用 Git 存储库几年了,但仍然感觉像个新手.. 非常欢迎帮助!

It starts cloning for a while:

它开始克隆一段时间:

remote: Counting objects: 22394<br>
remote: Compressing objects: 100% (12314/12314)<br>
Receiving objects: 32% ....

The error:

错误:

error: RPC failed; result=56, HTTP code = 200<br>
fatal: The remote end hung up unexpectedly<br>
fatal: early EOF<br>
fatal: index-pack failed

The git command:

git 命令:

git clone https://[username]:[password]@github.com/MegaWorldStudios/OmegatechV2.git "C:\OmegatechV2"

Git Version:
1.9.4-preview20140929 (downloaded/updated today from the git fellas)

Git 版本:
1.9.4-preview20140929(今天从 git 小伙伴下载/更新)

I found questions such as this one, but none of the answers solves the problem.

我发现了这样的问题,但没有一个答案能解决问题。

I've also tried:
Setting the postBuffer higher as mentioned from similar posts

我也试过:
如类似帖子中提到的那样将 postBuffer 设置得更高

git config http.postBuffer 524288000<br>
git config --global http.postBuffer 524288000

Setting --depth 1 and doing a shallow clone that I can later pull the rest

设置 --depth 1 并做一个浅克隆,我以后可以拉其余的

Setting --depth 2

设置 --depth 2

error: RPC failed; result=18, HTTP code = 200
Cloning from a branch other than the main branch
Reinstalling the software and updating

What does this infernal error mean and what's the fix/workaround?

这个地狱般的错误是什么意思,修复/解决方法是什么?

Thanks so much in advance!

非常感谢!

回答by Hanxue

This error occurs due to Git's HTTPS protocol. To view the error in detail, you can set the GIT_CURL_VERBOSEenvironment variable. For example:

这个错误是由于 Git 的 HTTPS 协议造成的。要详细查看错误,可以设置GIT_CURL_VERBOSE环境变量。例如:

$ GIT_CURL_VERBOSE=1 git pull

Your Antivirus or Firewall could be modifying the HTTP packets in transit. See git clone failed due to antivirusfor example.

您的防病毒软件或防火墙可能正在修改传输中的 HTTP 数据包。例如,请参阅git clone 由于防病毒失败

Finally, it could be an unreliable network connection. I am using an OSX machine connected to Wifi, and the problem disappeared when I switch to a LAN connection.

最后,它可能是一个不可靠的网络连接。我使用的是连接到 Wifi 的 OSX 机器,当我切换到 LAN 连接时问题消失了。

回答by Mukesh Chapagain

I faced the similar error. Tried to configure http.postBufferbut it didn't work.

我遇到了类似的错误。尝试配置,http.postBuffer但没有奏效。

I found about the same error (with solution) over here: Git Clone Fails - error: RPC failed; result=56, HTTP code = 200

我在这里发现了相同的错误(带有解决方案):Git Clone Fails - error: RPC failed; 结果 = 56,HTTP 代码 = 200

As suggested in the above link, I solved it out by using SSH to perform the clone.

正如上面链接中所建议的,我通过使用 SSH 执行克隆解决了这个问题。

Here is a good tutorial on how to Setup SSH for Git.

这是一个关于如何为 Git 设置 SSH的好教程。

回答by gogstad

Git clone with a HTTPS url is not supported by the git binary shipped currently in debian and ubuntu. See this answerfor a workround.

当前在 debian 和 ubuntu 中提供的 git 二进制文件不支持带有 HTTPS url 的 Git 克隆。请参阅此答案以获取解决方法。

回答by bigassforce

This is a problem specific to Atlassian Stashand Mac OSXgit client. Workaround:

这是Atlassian StashMac OSXgit 客户端特有的问题。解决方法:

  1. Install HomeBrew following the instructions here: http://brew.sh/

  2. Follow the solution provided in this gistcourtesy of entropiae:

    $ brew remove git
    $ brew remove curl
    
    $ brew install openssl
    $ brew install --with-openssl curl
    $ brew install --with-brewed-curl --with-brewed-openssl git
    

    (this installs a working binary in eg /usr/local/Cellar/git/2.10.2/bin/git)

  3. Tell your IDE to use that binary, or you can run it from the command line to clone / push etc

  1. 按照此处的说明安装 HomeBrew:http://brew.sh/

  2. 按照entropiae提供的本要点中提供的解决方案:

    $ brew remove git
    $ brew remove curl
    
    $ brew install openssl
    $ brew install --with-openssl curl
    $ brew install --with-brewed-curl --with-brewed-openssl git
    

    (这会在 eg 中安装一个工作二进制文件/usr/local/Cellar/git/2.10.2/bin/git

  3. 告诉您的 IDE 使用该二进制文件,或者您可以从命令行运行它来克隆/推送等

回答by Luan Vo

I faced the same issue on Mac OSX when attempting push my code to bitbucket. I made 2 following steps to resolve the issue:

尝试将我的代码推送到 bitbucket 时,我在 Mac OSX 上遇到了同样的问题。我做了以下两个步骤来解决这个问题:

  1. Increase the buffer with command: git config http.postBuffer 524288000

  2. Change protocol from HTTPS to SSH. This is the main key to resolve the issue. You can refer to https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.htmlfor more information.

  1. 使用命令增加缓冲区: git config http.postBuffer 524288000

  2. 将协议从 HTTPS 更改为 SSH。这是解决问题的关键。您可以参考https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html了解更多信息。

回答by zachzins

Posting here because this was one of the first Google results for 'RPC failed; result=56, HTTP code = 200'.

在这里发帖是因为这是“RPC 失败”的第一个 Google 搜索结果;结果 = 56,HTTP 代码 = 200'。

I tried many different things to get this issue resolved. I tried compiling git from source, adding gitconfig settings, and I even tried multiple configurations of my GitLab server. None of these things worked. I didn't understand why I could clone a repo successfully on the same subnet as my git server, but couldn't over a remote subnet (connected by site-to-site VPN).

我尝试了很多不同的方法来解决这个问题。我尝试从源代码编译 git,添加 gitconfig 设置,我什至尝试了我的 GitLab 服务器的多种配置。这些事情都没有奏效。我不明白为什么我可以在与我的 git 服务器相同的子网上成功克隆一个 repo,但不能通过远程子网(通过站点到站点 VPN 连接)。

The issue ended up being my firewall. I white-listed the client and everything started working. Temporarily placing the client in a DMZ may also be a quick fix.

问题最终是我的防火墙。我将客户列入白名单,一切都开始工作了。将客户端临时放置在 DMZ 中也可能是一个快速解决方案。

回答by Tarun Chawla

I faced the same issue while cloning a very large repository. I tried with configuring http.postBuffer, but it did not work for me. Finally, it was issue with my internet.

我在克隆一个非常大的存储库时遇到了同样的问题。我尝试配置 http.postBuffer,但它对我不起作用。最后,这是我的互联网问题。

I connected my laptop to a high speed Internet and it cloned successfully!

我将笔记本电脑连接到高速互联网并成功克隆!