簡體   English   中英

Git Fetch 在 Windows 中返回“致命:我不處理協議 https”

[英]Git Fetch returns 'fatal: I don't handle protocol https' in windows

添加遠程git fetch remoteRepoName后,我嘗試git fetch remoteRepoName但它返回此錯誤:

fatal: I don't handle protocol 'https'

我探索了相關問題,但其中大部分屬於git clone所以他們的答案在我的情況下不起作用。 這是一個屏幕截圖:

在此處輸入圖片說明

我可以看到 forkgeek 和 https://... 在線 3 之間的額外空格。

運行這些命令來修復它。

git remote remove forkgeek

git remote add upstream https://github.com/forkgeeks/aws-cloudwatch-keen-integration.git

git fetch upstream

我已將 forkgeek 更改為上游,您可以使用任何名稱。

git config --local -e

這將在 Vim 中打開 repo 的配置文件,您可以在其中刪除導致此錯誤的額外/特殊字符。

如果您在運行后遇到問題

git push origin master
fatal: I don't handle protocol 'https'


修復它刪除該引用

git remote rm origin
#then check is all worked well
git remote -v

現在您可以再次添加遠程存儲庫的 url

git remote add origin https://example.com/user/repo.git
#and check
git remote -v
#And push the changes in your local repository to github
git push origin master

此問題可能與無效的源 URL 相關。

要檢查 repo URL,請執行以下命令

git remote -v

它將顯示原始網址,然后更改為正確的網址。 以下是該命令。

git remote set-url origin https://github.com/**USERNAME/REPOSITORY**.git

再次使用命令驗證

git remote -v

有關更多信息,請參閱此鏈接

https://help.github.com/articles/changed-a-remote-s-url/

我是 git 新手,剛才遇到了類似的問題,原因是我嘗試使用 ctrl+V(我在 Windows 上)ad 然后 ctrl+shift+v 將鏈接粘貼到 git bash 中的 GitHub 存儲庫當它不起作用時,我只是手動編寫鏈接,當我運行命令時,它告訴我我不處理 https,這是因為 ctrl+v 是他們在上面的答案中談到的特殊字符,所以我重新啟動 bash 並從一開始就手動輸入鏈接,它起作用了,希望它有所幫助。

git config --global http.sslVerify false

我之前也遇到過同樣的問題,但這是一個簡單的解決方法,我在“https”之前有一個空格。 解決了這個問題,就像一個魅力。

錯誤是因為您的 forgeek url 中的尾隨空格,您可以將其解析為

git pull https://github.com/forkgeeks/aws-cloudwatch-keen-integration.git master

當我按 ctrl + v 右鍵單擊​​並通過鏈接時,我遇到了同樣的問題,當我再次嘗試時,只需右鍵單擊並通過它就可以了

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM