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

隐身守侯 提交于 2019-11-27 14:40:09
Hanxue

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

$ GIT_CURL_VERBOSE=1 git pull

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

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.

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

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

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

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

gogstad

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

This is a problem specific to Atlassian Stash and Mac OSX git client. Workaround:

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

  2. Follow the solution provided in this gist courtesy 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

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

  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.html for more information.

Posting here because this was one of the first Google results for 'RPC failed; result=56, HTTP code = 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).

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!