簡體   English   中英

Windows Git-bash致命:無法從遠程存儲庫讀取。 當推SSH

[英]Windows Git-bash fatal: Could not read from remote repository. when pushing through ssh

我正在使用Windows Git-bash使用ssh(不是https)將其推送到我的存儲庫。 我已按照此頁面中的說明進行操作

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

$ ssh-keygen -t rsa -b 4096 -C "barghouti_since88@hotmail.com"
$ ssh-add ~/.ssh/id_rsa

然后將密鑰復制到〜/ .ssh / id_rsa中,並按照以下設置將其復制到github帳戶中的ssh密鑰中

https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

但是現在當我嘗試推動使用

$git add file
$git commit -m "adding file"
$git push

我得到以下

FATAL ERROR: Couldn't agree a key exchange algorithm (available: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521)
fatal: Could not read from remote repository.

請確保您具有正確的訪問權限,並且存儲庫存在。

您可以檢查以下幾種可能性:

  • 您是否使用“ https”而不是“ git”“ git clone”存儲庫? 如果要使用ssh進行git push,則還需要使用ssh進行克隆。
  • 您的Windows版Git是否足夠新? GitHub偶爾會刪除對較舊,較弱的加密貨幣的支持,並且您的軟件需要與服務器的算法匹配,在這種情況下,錯誤消息不會匹配該算法。
  • 您是否使用與git相同的ssh軟件? Git for Windows附帶了ssh,但是ssh也可以單獨安裝,例如作為OpenSSH單獨安裝,或包含在膩子中。 將“ where ssh-keygen”的輸出與環境變量GIT_SSH進行比較。

希望這可以幫助

暫無
暫無

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

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