git:致命:我不处理协议“??http”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30474447/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:14:48  来源:igfitidea点击:

git: fatal: I don't handle protocol '??http'

gitclonewhitespace

提问by guettli

I copy and pasted an git clone command from a web page: https://fedorahosted.org/ibus-typing-booster/

我从网页上复制并粘贴了一个 git clone 命令:https: //fedorahosted.org/ibus-typing-booster/

I got this:

我懂了:

user@host> git clone ??http://git.fedorahosted.org/git/ibus-typing-booster.git

Cloning into 'ibus-typing-booster'...
fatal: I don't handle protocol '??http'

回答by guettli

I copied and pasted the whole line git clone http://....

我复制并粘贴了整行git clone http://...

The character between git cloneand http://...looks like a space, but it is a special Unicode character!

git clone和之间的字符http://...看起来像一个空格,但它是一个特殊的 Unicode 字符

Short answer: After removing this character, and entering a real space, it worked!

简短回答:删除此字符并进入真实空间后,它起作用了!

For people who love details: I see two ways to reveal ascii vs special-unicode-characters

对于喜欢细节的人:我看到了两种显示 ascii 和特殊 unicode 字符的方法

Way1: Python

方式一:Python

Here is the real line:

这是真正的线路:

vi t.txt # copy+paste the line
python
open('t.txt').read()
git clone \xe2\x80\x8b\xe2\x80\x8bhttp://...

Way2: less

方式2:少

vi t.txt # copy+paste the line
LESSCHARSET=ascii less vi.txt

If it looks like git clone <E2><80><8B><E2><80><8B>http://, then you copy+pasted special-unicode-characters.

如果它看起来像git clone <E2><80><8B><E2><80><8B>http://,那么您复制+粘贴特殊 unicode 字符。

回答by Felipe Belluco

Use backspace to delete whatever there is between git cloneand the urland then use spacebar to add a clean space between them. Simple as that.

使用退格键删除git clone和之间的任何内容url,然后使用空格键在它们之间添加一个干净的空间。就那么简单。

回答by J.Hpour

I simply added 5"SPACE"s between cloneand the url:

我只是在和之间添加了5 个“空格” :cloneurl

  git clone     ?https://<PATH>/<TO>/<GIT_REPO>.git

and it works!

它有效!

回答by Rajan

Summary: Type the url instead of copy pasting it in the commandline. It worked for me.

总结:在命令行中输入 url 而不是复制粘贴。它对我有用。

回答by Paritosh Mahajan

Mostly it is due to some invisible unicode characters which can come if you hit "Ctrl+V" or "Ctrl+Shift+V" in the terminal. Don't copy and paste the whole command. Instead , typegit clone and then copy and paste the urlusing Right Click + Paste.

主要是由于一些不可见的 unicode 字符,如果您在终端中点击“Ctrl+V”或“Ctrl+Shift+V”,就会出现这些字符。不要复制和粘贴整个命令。相反,键入git clone,然后使用右键单击 + 粘贴复制并粘贴url

回答by Christian Carrillo

My solution:

我的解决方案:

  1. Type: git clone.
  2. Copy the repository url and paste it after of git clone.
  3. Move the cursor to position between git cloneand https://....
  4. Delete space if it had between git cloneand https://...until have git clonehttps://...
  5. Re-add the space and press Enter.
  1. 类型:git clone
  2. 复制存储库 url 并将其粘贴到git clone.
  3. 将光标移动到git clone和之间的位置https://...
  4. 删除空间,如果它之间有git clonehttps://...直到有git clonehttps://...
  5. 重新添加空格并按Enter

回答by mhn

I used double quotes for the URL and it worked. So something like

我对 URL 使用了双引号并且它起作用了。所以像

git clone "??http://git.fedorahosted.org/git/ibus-typing-booster.git"

works.. single quotes dont help. It has to be double quotes.

作品..单引号没有帮助。它必须是双引号。

回答by Zovfreullia

You can also use a text editor:

您还可以使用文本编辑器:

  • Paste the URL in the text editor
  • Copy the URL that was just pasted from the text editor
  • Paste it in the command line
  • 在文本编辑器中粘贴 URL
  • 复制刚刚从文本编辑器中粘贴的 URL
  • 粘贴到命令行

回答by Reezoo Bose

Please do not copy from the clipboard . Just copy the url from your browser's location / Address bar .enter image description here

请不要从剪贴板复制。只需从浏览器的位置/地址栏中复制 url。在此处输入图片说明

回答by Arsen

The same issue happened with me when I have just copied the url into the clipboard and then pasted it into the terminal. Rewriting whole the line without copy-past option resolved my issue.

当我刚刚将 url 复制到剪贴板然后将其粘贴到终端时,同样的问题发生在我身上。在没有复制过去选项的情况下重写整行解决了我的问题。