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 ?
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.
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.
You have two options:
- Clone the repo using SSH
- Recompile git against
libcurl4-openssl-dev
(libcurl4-gnutls-dev
didn't work for me)
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.
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
I solved it by using SSH to perform the clone. Solution found here.
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.
Here's how to Setup SSH for Git.
I have the same problem on my Ubuntu environment, run export GIT_CURL_VERBOSE=1
solve it. Here is the link.