一、問題由來
今天在Windows上學習git clone將遠程版本庫克隆到本地時的操作不當引起fatal: protocol 'https' is not supported,是我們在這方面常犯的一個錯誤。
二、解決辦法
在stackoverflow
上找到了解決方案和原因,其中是這么寫到的:
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.
在我們使用ctrl + c/v 進行復制粘貼操作,在git bash中沒有效果,下意識右鍵粘貼,但是不幸的是,使用 CTRL +V
會在Git Bash 中添加一個隱藏的符號 ^?
。所以在git bash中可能出現
$ git clone ^?https://github.com/shi-bash-cmd/myweather.git
鏈接前面多了符號,協議變成了^https
,肯定不能克隆成功,提示協議不支持。跟linux系統中的復制粘貼不同,在命令行中盡量小心使用ctrl + c/v
三、參考鏈接
https://stackoverflow.com/questions/53988638/git-fatal-protocol-https-is-not-supported