我无法克隆HTTPS存储库。我可以克隆SSH回购很好,但不是HTTPS回购。我无法测试GIT协议,因为我位于公司防火墙后面。

这就是我要做的:

$ git clone https://github.com/nvie/gitflow.git
Cloning into gitflow...
fatal: Unable to find remote helper for 'https'

到目前为止,我尝试了以下(基于谷歌搜索)

通过apt-get清洗和安装Git 通过apt-get为Git安装build-deps 安装curl开发库 安装外派库 下载Git源代码并使用以下方法构建: ./configure——prefix=/usr——with-curl——with-expat 还尝试在curl binary(。——prefix=/usr——with-curl=/usr/bin/curl)

我已经试遍了我在网上能找到的所有东西,但都没有成功。有人能帮帮我吗?

转到版本 = 1.7.6.4

操作系统 = Ubuntu 11.04


当前回答

我有同样的问题和简单的解决它。

只需卸载git并重新安装即可。

#apt-get remove --purge git-svn git-core
#rm /usr/local/bin/git
#apt-get install git-svn git-core

一切都很顺利。

希望这对你有所帮助。

其他回答

我曾经来过这里,因为我正在处理git本身。当我构建它时,默认的makefile将二进制文件安装在~/bin/git中。因为我的路径有~/bin首先当我运行'git拉-rebase'时,它使用了~/bin中的一个,因此无法定位帮助程序。

我通过运行'/usr/bin/git…'带有完整的路径(或者我可以调整我的路径)。

看起来在编译git时没有安装(lib)curl-devel会导致这种情况。

如果你安装(lib)curl-devel,然后重新构建/安装git,这应该可以解决问题:

$ yum install curl-devel
$ # cd to wherever the source for git is
$ cd /usr/local/src/git-1.7.9  
$ ./configure
$ make
$ make install

这在Centos 6.3上很适用。

如果你没有yum,你可以在这里下载源代码来curl-devel:

http://curl.se/dlwiz/?type=devel


如果你运行的是Ubuntu:

sudo apt-get install libcurl4-openssl-dev 

在我的情况下,没有什么是成功的,一段时间后,看看发生了什么,我发现这在我的配置文件。不知道它是怎么来的

% cat ~/.gitconfig 
[user]
    email = xxxxxxx@gmail.com
    name = xxxxxx
[alias]
    g = grep -n -i --heading --break
[url "git+https://github.com/"]
    insteadOf = git@github.com:
[url "git+https://"]
    insteadOf = git://

删除url属性后,一切工作正常

在我的例子中,git——exec-path指向正确的路径,git-remote-https存在,但没有执行权限。所以chmod +x git-remote-http修复了这个问题。

以防有人在QNAP系统或任何其他以OPKG作为包管理器的系统上遇到这种情况:

你需要安装git-http和git。如:

opkg install git-http