Git fatal: protocol 'https' is not supported

前端 未结 15 1344
我寻月下人不归
我寻月下人不归 2021-01-29 21:32

I am going through Github\'s forking guide: https://guides.github.com/activities/forking/ and I am trying to clone the repository onto my computer. However, running the command:

相关标签:
15条回答
  • 2021-01-29 21:46

    Problem is probably this.

    You tried to paste it using

    • CTRL +V

    before and it didn't work so you went ahead and pasted it with classic

    • Right Click - Paste**.

    Sadly whenever you enter CTRL +V on terminal it adds

    • a hidden ^?

    (at least on my machine it encoded like that).

    the character that you only appears after you

    • backspace

    (go ahead an try it on git bash).

    So your link becomes ^?https://...

    which is invalid.

    0 讨论(0)
  • 2021-01-29 21:48

    This issue persisted even after the fix from most upvoted answer.

    More specific, I pasted in the link without "Ctrl + v", but it still gave fatal: protocol 'https' is not supported.

    But if you copy that message in Windows or in Google search bar you will that the actual message is fatal: protocol '##https' is not supported, where '#' stands for this character. As you can see, those 2 characters have not been removed.

    I was working on IntelliJ IDEA Community Edition 2019.2.3 and the following fix refers to this tool, but the answer is that those 2 characters are still there and need to be removed from the link.

    IntelliJ fix

    Go to top bar, select VCS -> Git -> Remotes... and click.

    Now it will open something link this

    You can see those 2 unrecognised characters. We have to remove them. Either click edit icon and delete those 2 characters or you can delete the link and add a new one.

    Make sure you have ".git" folder in your project folder.

    And now it should like this. Click "Ok" and now you can push files to your git repository.

    0 讨论(0)
  • 2021-01-29 21:55

    Copy in plain notepad (git clone https://github.com/./Spoon-Knife.git) and paste it in cmd. now it will work.

    0 讨论(0)
  • 2021-01-29 21:58

    Just use double quotes with URL, like: git clone "https://yourRepoUrl"

    (It somehow sees that you are using 2 quote marks on start, don't know why).

    I was getting the same error => fatal: protocol ''https' is not supported (you can see 2 quote marks on https).

    0 讨论(0)
  • 2021-01-29 21:59

    There is something fishy going on. Probably a github bug that is not consistent (A/B testing?)

    I am on windows10, using firefox. I have just copied a checkout URL and got an extra character. But only the first time. A second time it wasn't there. I had to look at my history file to see it!

    here is my history:

    git clone --recursive https://github.com/amzeratul/halley-template
    git clone --recursive http://github.com/amzeratul/halley-template
    git clone --recursive github.com/amzeratul/halley-template
    git clone --recursive https://github.com/amzeratul/halley-template
    

    the history command doesn't show the extra char. Just like it wasn't rendered when i was copy-pasting it into the terminal. You can see how i tried to remove the 's' and then the entire protocol? I was only triggered to investigate further when the backspace key moved one less character than i was expecting!

    I saved my shell history file onto a machine with an hex editor and:

    00000000  xx xx xx xx xx xx xx 0a  67 69 74 20 63 6c 6f 6e  |xxxxxxx.git clon|
    00000010  65 20 2d 2d 72 65 63 75  72 73 69 76 65 20 c2 96  |e --recursive ..|
    00000020  68 74 74 70 73 3a 2f 2f  67 69 74 68 75 62 2e 63  |https://github.c|
    00000030  6f 6d 2f 61 6d 7a 65 72  61 74 75 6c 2f 68 61 6c  |om/amzeratul/hal|
    00000040  6c 65 79 2d 74 65 6d 70  6c 61 74 65 0a 67 69 74  |ley-template.git|
    00000050  20 2d 2d 68 65 6c 70 0a  67 69 74 20 75 70 64 61  | --help.git upda|
    00000060  74 65 2d 67 69 74 2d 66  6f 72 2d 77 69 6e 64 6f  |te-git-for-windo|
    00000070  77 73 0a 67 69 74 20 63  6c 6f 6e 65 20 2d 2d 72  |ws.git clone --r|
    00000080  65 63 75 72 73 69 76 65  20 c2 96 68 74 74 70 73  |ecursive ..https|
    00000090  3a 2f 2f 67 69 74 68 75  62 2e 63 6f 6d 2f 61 6d  |://github.com/am|
    000000a0  7a 65 72 61 74 75 6c 2f  68 61 6c 6c 65 79 2d 74  |zeratul/halley-t|
    000000b0  65 6d 70 6c 61 74 65 0a  63 75 72 6c 20 2d 2d 76  |emplate.curl --v|
    000000c0  65 72 73 69 6f 6e 0a 63  64 20 63 6f 64 65 0a 67  |ersion.cd code.g|
    000000d0  69 74 20 63 6c 6f 6e 65  20 2d 2d 72 65 63 75 72  |it clone --recur|
    000000e0  73 69 76 65 20 c2 96 68  74 74 70 73 3a 2f 2f 67  |sive ..https://g|
    000000f0  69 74 68 75 62 2e 63 6f  6d 2f 61 6d 7a 65 72 61  |ithub.com/amzera|
    00000100  74 75 6c 2f 68 61 6c 6c  65 79 2d 74 65 6d 70 6c  |tul/halley-templ|
    00000110  61 74 65 0a 67 69 74 20  63 6c 6f 6e 65 20 2d 2d  |ate.git clone --|
    00000120  72 65 63 75 72 73 69 76  65 20 c2 96 68 74 74 70  |recursive ..http|
    00000130  3a 2f 2f 67 69 74 68 75  62 2e 63 6f 6d 2f 61 6d  |://github.com/am|
    00000140  7a 65 72 61 74 75 6c 2f  68 61 6c 6c 65 79 2d 74  |zeratul/halley-t|
    00000150  65 6d 70 6c 61 74 65 0a  67 69 74 20 63 6c 6f 6e  |emplate.git clon|
    00000160  65 20 2d 2d 72 65 63 75  72 73 69 76 65 20 67 69  |e --recursive gi|
    00000170  74 68 75 62 2e 63 6f 6d  2f 61 6d 7a 65 72 61 74  |thub.com/amzerat|
    00000180  75 6c 2f 68 61 6c 6c 65  79 2d 74 65 6d 70 6c 61  |ul/halley-templa|
    00000190  74 65 0a 67 69 74 20 63  6c 6f 6e 65 20 2d 2d 72  |te.git clone --r|
    000001a0  65 63 75 72 73 69 76 65  20 68 74 74 70 73 3a 2f  |ecursive https:/|
    000001b0  2f 67 69 74 68 75 62 2e  63 6f 6d 2f 61 6d 7a 65  |/github.com/amze|
    000001c0  72 61 74 75 6c 2f 68 61  6c 6c 65 79 2d 74 65 6d  |ratul/halley-tem|
    000001d0  70 6c 61 74 65 0a                                 |plate.|
    000001d6
    

    There i a c2 96 char inserted before the url. No idea what that is. Is it not extended ASCII (where it would be –) and it was hidden from almost every place i pasted while it was on the clipboard. The closest i've found with this hex value would be https://www.fileformat.info/info/unicode/char/c298/index.htm but i didn't see the utf prefix anywhere (again, might have been lost)

    This all might be misleading as I lost the page/clipboard and am working exclusively from the saved shell history file, which might very well be missing data from the original bug/malicious injection.

    0 讨论(0)
  • 2021-01-29 21:59

    Problem

    git clone https://github.com/rojarfast1991/TestGit.git fatal: protocol 'https' is not supported

    Solution:

    Steps:

    (1):- Open the new terminal and clone the git repository

    git clone https://github.com/rojarfast1991/TestGit.git

    (2) Automatic git login prompt will open and it will be asked you to enter a user credential.

    UserName : - xxxxxxx

    PassWord : - xxxxxxx

    Finally, cloning will start...

    git clone https://github.com/rojarfast1991/TestGit.git
    Cloning into 'TestGit'...
    remote: Enumerating objects: 4, done.
    remote: Counting objects: 100% (4/4), done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (4/4), done.
    
    0 讨论(0)
提交回复
热议问题