312

I copy and pasted an git clone command from a web page: 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'
Tim
  • 41,901
  • 18
  • 127
  • 145
guettli
  • 25,042
  • 81
  • 346
  • 663
  • You can also take the (correct) URLs from the bottom of the repository view [here](https://git.fedorahosted.org/git/ibus-typing-booster.git). – poke May 27 '15 at 06:30
  • @poke the URL is correct. I don't understand what you want to tell me. – guettli May 27 '15 at 08:05
  • You can copy/paste it from there. It’s the URL generated by the repository viewer, and not a manually inserted one in some wiki, so it’s likely more correct. – poke May 27 '15 at 08:33
  • 16
    This happened to me using msys-git and trying to paste (with ctrl-v and ctrl-shift-v), before realizing they were not valid keyboard shortcuts. Redoing the command and pasting with right-click->paste seemed to work. – Casey Kuball Apr 05 '16 at 17:58
  • 1
    for me editing start of the protocol and retyping the same fixed it. May be some invisible utf characters messed things. – Seeni Jul 27 '18 at 02:21

20 Answers20

635

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

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

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

Way1: 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

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.

guettli
  • 25,042
  • 81
  • 346
  • 663
  • 8
    Nice find! The reason for that is probably that icon there. – poke May 27 '15 at 06:32
  • 5
    I spent 3 hours looking for a problem with SSH / keys / connection / submitting the keys to Gitlab just because I had a publickey denied message. :/ Then I switched to https and got the "don't handle" message, which tipped me of. And all that trouble was thanks to Unicode space-look-alike. Many, many thanks to you @guettli and Google/SO combo that led me here. – LAFK 4Monica_banAI_modStrike Apr 14 '16 at 21:49
  • 3
    Thank you. I see two ways to get work-arounds: git could strip those special characters or the shell (I use bash). I wasted time, you wasted time .... if you summarize this, I guess this could be years of human time ... wasted. It's sad. – guettli Apr 15 '16 at 05:01
  • why does the space I type in convert to the Unicode character? There is no reason for that character to appear there, right? – Ooker May 30 '16 at 09:06
  • I did not type the character. I used copy+paste. If you type, there won't be a special character. Maybe if you accidentally insert a non-break space. See http://unix.stackexchange.com/questions/154745/how-can-i-write-a-non-breaking-space – guettli May 30 '16 at 09:09
  • 5
    same here - copying link from github into windows GIT shell – ootwch Jun 05 '16 at 16:14
  • 1
    @CiroSantilli烏坎事件2016六四事件法轮功 thank you! `xsel` outputs the clipboard content, and `hd` does a hex dump. Nice. – guettli Mar 03 '17 at 08:59
  • 1
    A true solution. This post should be locked to prevent spam – Callat Feb 06 '18 at 22:32
  • @Calrog you want this post/answer to get locked? Why? What are you afraid of? – guettli Feb 07 '18 at 09:49
  • General answer spam, this has been asked and answered already years ago and is still getting new answers which is misleading. There are several age old questions I've come across that have quality answers that are locked for extra comments and new answers. I believe that this question falls into that category. – Callat Feb 07 '18 at 15:43
  • `<80><8B>` is actually the UTF-8 encoding of the unicode code point for the zero-width whitespace character `U+200B`, which some browsers may erroneously add when rendering certain elements - this is probably what happened in your case. This can be seen in a Python2 interpreter by setting some variable equal to the url in your description, then executing `var.decode('utf-8')`, which prints `u'git clone \u200b\u200bhttp://git.fedorahosted.org/git/ibus-typing-booster.git'`. As mentioned above, another way these characters can sneak in is from hitting `ctrl-v`, followed by `ctrl-shift-` – mhouglum Jun 10 '18 at 10:49
58

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

Felipe Belluco
  • 1,102
  • 10
  • 12
27

I simply added 5 "SPACE"s between clone and the url:

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

and it works!

J.Hpour
  • 971
  • 11
  • 20
  • @guettli It works just when adding 5 space between clone and http(s)! when I read [this answer](https://stackoverflow.com/a/30474448/4969485) I try to add some space, because of I was in a hurry and I could not use [this](https://stackoverflow.com/a/30474448/4969485) solution. It was accidentally and I don't know why it works! – J.Hpour Mar 27 '18 at 04:04
17

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

Rajan
  • 1,501
  • 4
  • 21
  • 37
  • 2
    Summary from above answer: The character between clone and http://... looks like a space, but it is a special Unicode character! After removing this empty character, and entering a real space, it worked! The stuff with t.txt is just for people who are interested in the the "why" and not only in "works". – guettli Dec 30 '15 at 20:41
  • 1
    This was already mentioned in several other answers (including the accepted answer). – Pika Supports Ukraine Jun 03 '19 at 21:29
14

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 , type git clone and then copy and paste the url using Right Click + Paste.

14

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 clone and https://... .
  4. Delete space if it had between git clone and https://... until have git clonehttps://...
  5. Re-add the space and press Enter.
Mostafa Norzade
  • 1,578
  • 5
  • 24
  • 40
Christian Carrillo
  • 2,751
  • 2
  • 9
  • 15
11

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

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

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

mhn
  • 2,660
  • 5
  • 31
  • 51
5

The solution is very simple:

1- Copy your git path. forexample : http://github.com/yourname/my-git-project.git

2- Open notepad and Paste it. Then copy the path from notepad.

3- paste the path to command line

thats it.

Fatihd
  • 635
  • 6
  • 12
4

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
4

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

Reezoo
  • 180
  • 8
  • The url was not in my address bar. It was plain text in a wiki. – guettli Sep 11 '17 at 07:27
  • no.. when paste URL in git bash.Suppose after git clone {your repo URL}.it takes additional character between clone and your repo URL. which you can check by deleting or hitting backspace before your repo url – Naveen Gupta Jan 07 '18 at 16:32
3

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.

Arsen
  • 654
  • 8
  • 20
  • Why do you write this answer? Do you think the current answer is missing something? – guettli Dec 22 '16 at 07:41
  • 1
    Hi guettli, Are you sure that rewriting only the space character will resolve the mentioned issue in all possible cases? Is it possible to have something redundant/incorrect not in the white space but in the symbols included in url text as well? – Arsen Dec 23 '16 at 09:01
  • of course special unicode characters can be anywhere. I added a second way to "reveal ascii vs special unicode characters" to my answer. – guettli Dec 23 '16 at 09:10
3

In Android Studio:

I removed git clone and just retain the url only and it worked!!

Suraj Vaishnav
  • 7,777
  • 4
  • 43
  • 46
1

clonning below :

git clone https://github.com/zendframework/ZendSkeletonApplication.git

gives error:

Cloning into 'ZendSkeletonApplication'...
fatal: I don't handle protocol 'https'

Modified it to:

git clone https://github.com/zendframework/ZendSkeletonApplication

works perfectly or you can just git clone the url. I am using os windows 10 and gitbash.

vidur punj
  • 5,019
  • 4
  • 46
  • 65
1

Please Check URL you have pasted and It takes additional h after clone.

So either you have paste full git clone http://<URL>.git or just remove additional letter before git repository URL.

J.Hpour
  • 971
  • 11
  • 20
Naveen Gupta
  • 306
  • 3
  • 11
1

if you are using windows use 'url' speech marks to open and close your url eg git clone 'your-url-here'

Jeremy
  • 21
  • 4
1

This just happened to us without any whitespace issues, and changing https: to http: fixed it...

beroe
  • 11,784
  • 5
  • 34
  • 79
  • Nice, that this works for your. But I think the real issue was the special whitespace character which you removed by hitting backspace. I am unsure if this is really a valid answer to this question. – guettli Aug 26 '18 at 17:40
  • I don't think so. I typed it from scratch several times and got the same error. – beroe Aug 26 '18 at 19:52
  • and you got the error message "git: fatal: I don't handle protocol '​​http'"? – guettli Aug 27 '18 at 09:50
  • 1
    It's funny but I have this problem too and i fixed it with this solution and I am pretty sure I don't have any special whitespace characters – Babak Habibi Oct 16 '18 at 13:12
1

in visual studio code option git:clone i tried every thing e.g putting 5 backspace, deleting the special Unicode character! and putting space nothing works for me

solution works for me

simply open git bash and paste the whole git clone url and done,

it seems there is some issue with visual studio code

Yusuf Khan
  • 3,032
  • 3
  • 24
  • 31
1

Related answer with this question.
Error - fatal: I don't handle protocol 'git clone https'
I was trying to clone git project to my newly installed VScode in my Linux system, i was copied the entire url from bit bucket, which was like

git clone https://abc@bitbucket.org/abcuser/myproject.git


But actually it running command like

git clone git clone https://abc@bitbucket.org/abcuser/myproject.git

in the bit bucket.
So Simply do the following steps :
1. Enter Ctr+p; this will open command box. Enter and open 'Clone'
2. Now only paste the url of your git reposiratory here. eg: https://abc@bitbucket.org/abcuser/myproject.git
3. After that box for enter your git password will appear on screen. Enter your git password here.
4. Done.

tejraj
  • 300
  • 2
  • 4
  • 16
0

Well looks like if you copy paste the repository link you end up with this issue.

What I have noticed it this

  1. If you use the copy button on GitHub and then paste the URL in GitBash(Windows) it throws this error
  2. If you select the link and then paste then it works, or you could also just type the URL that works as well.

So I think it might be an issue with the GitHub copy button

0

If you are using Git Extensions GUI or GitHub Desktop (means if you're using any UI software and not command-line tool) to clone the repo then you have to copy and paste only the URL i.e. https://... So there is no need to have git clone before URL as That Software will do it itself.

Inzimam Tariq IT
  • 6,548
  • 8
  • 42
  • 69