Linux git 错误:无法处理 https
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5500247/
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 error: cannot handle https
提问by dementrock
when I tried to use git clone https://xxxI got the following error
I don't handle protocol 'https'
Could anyone please help me?
当我尝试使用 git clone https://xxx 时出现以下错误
我不处理协议“https”
有人可以帮我吗?
full message:
完整信息:
dementrock@dementrock-A8Se:~$ git clone https://git.innostaa.com/innostaa.git
dementrock@dementrock-A8Se:~$ git clone https://git.innostaa.com/innostaa.git
Cloning into innostaa...
克隆到innostaa...
fatal: Unable to find remote helper for 'https'
致命:无法找到“https”的远程助手
dementrock@dementrock-A8Se:~$ git --version
dementrock@dementrock-A8Se:~$ git --version
git version 1.7.4
版本 1.7.4
采纳答案by Sylvain Defresne
Version 0.99.9i
of git
probably does not support https
protocol.
版本0.99.9i
的git
可能不支持https
协议。
Try to install a more recent version of git
. The easiest solution would be to install it via apt-get
:
尝试安装更新版本的git
. 最简单的解决方案是通过apt-get
以下方式安装它:
$ apt-get update
$ apt-get install git
After that check that the correct version is used:
之后检查是否使用了正确的版本:
$ hash -r
$ which git
/usr/bin/git
If the returned string is not /usr/bin/git
, then you have another older version of git
in your PATH
that is masking the more recent one. Remove it.
如果返回的字符串不是/usr/bin/git
,那么你有其他旧版本git
中您PATH
所掩盖更近的一个。去掉它。
If you do not want to install git
via apt-get
or if you do not have administrator privilege on your machine, you can built it from source. You can download them from git website, and compilation should be as simple as:
如果你不想安装git
通过apt-get
,或者如果你没有你的计算机的管理员权限,可以从源代码建立它。你可以从 git website下载它们,编译应该像这样简单:
$ tar -xvfj git-1.7.4.2.tar.bz2
$ cd git-1.7.4.2
$ ./configure --prefix=$HOME/install
$ make && make install
After that, you'll have to add $HOME/install/bin
to your PATH
.
之后,您必须添加$HOME/install/bin
到您的PATH
.
$ hash -r
$ PATH="$HOME/install/bin:${PATH}"
$ git --version
git version 1.7.4.2
回答by Rauter
I had the same problem while trying to "fetch upstream". I solved it by getting the Git-read only address instead of the https.
我在尝试“获取上游”时遇到了同样的问题。我通过获取 Git 只读地址而不是 https 来解决它。
details: I had a forked repository that needed updated from its original repo. Using github's help I added a remote upstream and tried to fetch it.
详细信息:我有一个分叉存储库,需要从其原始存储库更新。使用 github 的帮助,我添加了一个远程上游并尝试获取它。
I then went to Git-hub and where I usually get the address of the the repo I clicked on the "Git-read only" button and got a new URL. I removed my past upstream and added another one with the new URL, which worked perfectly.
然后我去了 Git-hub,在那里我通常会得到 repo 的地址,我点击了“Git-read only”按钮并得到了一个新的 URL。我删除了我过去的上游,并添加了另一个带有新 URL 的内容,效果很好。
回答by Javid Dadashkarimi
I have same problem but the reason was in my configuration of my .git. I changed config file as follows:
我有同样的问题,但原因在于我的 .git 配置。我更改了配置文件如下:
.git/config
.git/配置
enter code here[remote "heroku"]
url = [email protected]:rocky-bayou-4315.git
fetch = +refs/heads/*:refs/remotes/heroku/*
rocky-bayou-4315 is my heroku application that has been created by $ heroku create
command.
Rocky-bayou-4315 是我通过$ heroku create
命令创建的 heroku 应用程序。
回答by Karl
Fixed this problem for Git 1.7.9 on Windows. Seemed to happen with many GIT instantiations on Windows. Had to do with the url not being properly escaped in the command line.
修复了 Windows 上 Git 1.7.9 的这个问题。似乎发生在 Windows 上的许多 GIT 实例化中。与 url 没有在命令行中正确转义有关。
Solution: Put the git repository URL in single quotes 'https://.......'
解决方案:将 git 存储库 URL 放在单引号中 'https://.......'
回答by richardxx
Just encountered this problem with git 1.7.9 on cygwin. Using the double quotes "" to wrap the https URL can solve my problem.
刚刚在 cygwin 上用 git 1.7.9 遇到了这个问题。使用双引号 "" 来包装 https URL 可以解决我的问题。
eg:
例如:
git clone "https://github.com/joyent/node.git"
git 克隆“ https://github.com/joyent/node.git”