git后面的代理:远程HEAD指的是不存在的裁判,无法结帐 [英] git behind proxy: remote HEAD refers to nonexistent ref, unable to checkout

查看:81
本文介绍了git后面的代理:远程HEAD指的是不存在的裁判,无法结帐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图通过https从github克隆任何存储库时,我们得到:

  git clone https://github.com /rails/rails.git 
克隆到rails ...
远程HEAD引用不存在的ref,无法检出

我们的服务器位于代理之后。我们已经适当地定义了http_proxy和https_proxy。所有其他功能正在工作。



git版本是1.7.5.4

服务器是Ubuntu Server 11.04。



请注意,由于这发生在我们尝试使用的 EVERY github存储库中,所以我们坚信这对存储库中的refs不是问题。我们已经尝试了jQuery和Rails等知名存储库 - 如果问题出现在这些存储库中,会有很多人抱怨。我强烈认为问题在于git和代理服务器,但是我的所有搜索引擎都没有找到解决方案。



作为附加数据点,克隆似乎可以正常工作他们是http。它只是https错误的克隆。



请注意,我不认为这个问题是重复的,因为带有此错误的其他问题重点关注问题存储库 - 不与git和代理一起工作。

解决方案

我通过这篇文章偶然发现了这个问题的解决方案:



http: //comments.gmane.org/gmane.comp.version-control.git/185459



这个问题显然是安装在libcurl版本中的一个错误Ubuntu服务器11.04。简单地运行apt-get install libcurl3-gnutls并不足以解决问题,因为它只是简单地报告已安装最新版本。



为了解决这个问题,我不得不手动安装最新的libcurl3-gnutls和两个依赖项,如下所示(显然,在将它们下载到我的系统之后):

  sudo dpkg -i libp11-kit0_0.6-0ubuntu2_amd64.deb 
sudo dpkg -i libgnutls26_2.12.14-3_amd64.deb
sudo dpkg -i libcurl3-gnutls_7.22.0-3ubuntu1_amd64.deb

希望这可以帮助别人。


When trying to clone ANY repository via https from github, we get:

git clone https://github.com/rails/rails.git
Cloning into rails...
remote HEAD refers to nonexistent ref, unable to checkout

Our server is behind a proxy. We have defined http_proxy and https_proxy appropriately. All other functions are working.

git version is 1.7.5.4

Server is Ubuntu Server 11.04.

Note that since this happens with EVERY github repository we've tried, we strongly believe it's not a problem with the refs in the repository. We've tried such well-known repositories as jquery and rails - if the problem were in those repositories there'd be a lot of people complaining. I believe strongly the problem is with git and the proxy, but all my googling has not lead to a solution.

As an additional data point, clones seem to work fine if they're http. It's only the https clones that fail with this error.

Note that I don't think this question is a duplicate, since the other questions with this error focus on problems with the repository - not working with git and a proxy.

解决方案

I've stumbled across the solution to this problem via this post:

http://comments.gmane.org/gmane.comp.version-control.git/185459

The issue is apparently a bug in the libcurl version installed in Ubuntu server 11.04. Simply running apt-get install libcurl3-gnutls was not sufficient to solve the problem since it simply reported the latest version was already installed.

To solve the problem, I had to manually install the latest libcurl3-gnutls, and two dependencies, as seen below (obviously, after having downloaded them to my system first):

sudo dpkg -i libp11-kit0_0.6-0ubuntu2_amd64.deb
sudo dpkg -i libgnutls26_2.12.14-3_amd64.deb
sudo dpkg -i libcurl3-gnutls_7.22.0-3ubuntu1_amd64.deb

Hope this helps someone.

这篇关于git后面的代理:远程HEAD指的是不存在的裁判,无法结帐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆