Git 克隆错误:RPC 失败;结果=56,HTTP 代码 = 200
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25442734/
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
Git clone Error: RPC failed; result=56, HTTP code = 200
提问by Oleh
I am trying to clone a (private) remote repository but I am getting following error:
我正在尝试克隆(私有)远程存储库,但出现以下错误:
remote: Counting objects: 11410, done
remote: Finding sources: 100% (11410/11410)
remote: Getting sizes: 100% (9178/9178)
error: RPC failed; result=56, HTTP code = 200
error: inflate: data stream error (invalid block type)
fatal: pack has bad object at offset 427781: inflate returned -3
I am using Git version 1.9.4 on Windows 8 Pro Build 9200. There are large files on that repo, but file size seems irrelevant to my problem because I still get the same error when I try to clone some other smaller repository (<20Mb with AppHarbor). Any ideas ?
我在 Windows 8 Pro Build 9200 上使用 Git 版本 1.9.4。该存储库中有大文件,但文件大小似乎与我的问题无关,因为当我尝试克隆其他一些较小的存储库(<20Mb)时仍然遇到相同的错误与 AppHarbor)。有任何想法吗 ?
采纳答案by Oleh
My sysadmin figured out that the problem was with Avast. If you're experiencing the same problem and you use Avast, then try disabling it. That fixed my problem.
我的系统管理员发现问题出在 Avast 上。如果您在使用 Avast 时遇到同样的问题,请尝试禁用它。那解决了我的问题。
回答by gogstad
The git binaries I've found in ubuntu and debian both have this bug. It's caused by a bug in GnuTLS which git is compiled against (tracked here). It's simply not possible to clone a git repo in Ubuntu or Debian with a HTTPS URL.
我在 ubuntu 和 debian 中找到的 git 二进制文件都有这个错误。它是由 GnuTLS 中的一个错误引起的,git 是针对该错误编译的(在此处跟踪)。根本不可能在 Ubuntu 或 Debian 中使用 HTTPS URL 克隆 git 存储库。
You have two options:
您有两个选择:
- Clone the repo using SSH
- Recompile git against
libcurl4-openssl-dev
(libcurl4-gnutls-dev
didn't work for me)
- 使用 SSH 克隆 repo
- 重新编译 git 对
libcurl4-openssl-dev
(libcurl4-gnutls-dev
对我不起作用)
In case you decide for option #2, here's a copy/paste to recompile the latest git on debian or ubuntu. The latest version of git is found here.
如果您决定选择选项 #2,这里有一个复制/粘贴来在 debian 或 ubuntu 上重新编译最新的 git。最新版本的 git 可以在这里找到。
apt-get update \
&& apt-get install -y build-essential libcurl4-openssl-dev libexpat1-dev gettext libz-dev libssl-dev autoconf \
&& wget https://github.com/git/git/archive/v2.8.1.tar.gz -O git.tar.gz \
&& tar -zxf git.tar.gz \
&& cd git-* \
&& make configure \
&& ./configure --prefix=/usr \
&& make install
回答by Mukesh Chapagain
I solved it by using SSH to perform the clone. Solution found here.
我通过使用 SSH 执行克隆解决了它。解决方案在这里找到。
To use SSH with Bitbucket, you create an SSH identity. An identity consists of a private and a public key which together are a key pair. The private key resides on your local computer and the public you upload to your Bitbucket account. Once you upload a public key to your account, you can use SSH to connect with repositories you own and repositories owned by others, provided those other owners give your account permissions. By setting up SSH between your local system and the Bitbucket server, your system uses the key pair to automate authentication; you won't need to enter your password each time you interact with your Bitbucket repository.
要将 SSH 与 Bitbucket 一起使用,您需要创建一个 SSH 身份。一个身份由一个私钥和一个公钥组成,它们共同构成一个密钥对。私钥位于您的本地计算机和您上传到 Bitbucket 帐户的公共密钥。将公钥上传到您的帐户后,您可以使用 SSH 连接到您拥有的存储库和其他人拥有的存储库,前提是其他所有者授予您的帐户权限。通过在您的本地系统和 Bitbucket 服务器之间设置 SSH,您的系统使用密钥对来自动进行身份验证;每次与 Bitbucket 存储库交互时,您都不需要输入密码。
Here's how to Setup SSH for Git.