windows - Windows Git-bash 致命:无法从远程存储库读取。通过 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 进行克隆。
- 你的 Git for Windows 版本够新吗?每隔一段时间,GitHub 就会删除对旧的、较弱的加密货币的支持,并且您的软件需要匹配服务器的算法,在这种情况下它没有匹配错误消息。
- 你使用与 git 相同的 ssh 软件吗?Git for Windows 附带了 ssh,但 ssh 也可以单独安装,例如作为 OpenSSH 单独安装,或者包含在 putty 中。将 'where ssh-keygen' 的输出与环境变量 GIT_SSH 进行比较。
希望这可以帮助
推荐阅读
- flutter - 有‘扑医生’吗?
- r - 在 R 中手动进行简单的聚类
- python-3.x - 具有矩阵类型输入的python混合整数线性规划
- php - 服务器端未正确读取授权承载
- javascript - 如何使用 CryptoJS 在 C# 中加密 AES
- javascript - 如何使用 fs 和批量请求读取多个 json 文件
- node.js - Nodejs 中的 Azure Bot Framework 网络聊天:将文本转换为语音时无法识别提示
- java - 生命周期配置未涵盖插件执行:org.bsc.maven:maven-processor-plugin:3.3.3:process
- swift - 有没有办法检测发布者何时有新订阅者?| 迅捷,结合
- azure - Azure OPDG 系统聚合日志到 KQL 中的 TimeChart