【问题标题】:Windows Git-bash fatal: Could not read from remote repository. when pushing through sshWindows Git-bash 致命:无法从远程存储库读取。通过 ssh 推送时
【发布时间】:2019-07-03 15:45:12
【问题描述】:

我正在使用 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.

请确保您拥有正确的访问权限 并且存储库存在。

【问题讨论】:

  • 请显示 git remote show origin.

标签: windows git github ssh git-bash


【解决方案1】:

您可以检查以下几种可能性:

  • 您是否使用“https”而不是“git”“git 克隆”存储库?如果 你想用 ssh 进行 git push,你也需要用 ssh 克隆。
  • 您的 Git for Windows 版本是否足够新?每隔一段时间,GitHub 就会删除对旧的、较弱的、加密的和你的 软件需要匹配服务器的算法,在这种情况下 根据错误消息,它没有。
  • 您是否使用与 git 相同的 ssh 软件? Git for Windows 自带 ssh,但 ssh 也可以单独安装, 例如,它可以作为 OpenSSH 单独使用,也可以包含在 putty 中。比较 带有环境变量的“where ssh-keygen”的输出 GIT_SSH。

希望对你有帮助

【讨论】:

    猜你喜欢
    • 2015-11-21
    • 2012-11-10
    • 2015-01-19
    • 1970-01-01
    • 1970-01-01
    • 2019-11-11
    • 1970-01-01
    • 2014-09-01
    • 1970-01-01
    相关资源
    最近更新 更多