git - 对于git,如何知道网络是否支持ssh或https?

标签 git github ssh

我正在使用新的网络。但是,当我尝试从Github克隆存储库时,git clone git@github.com:myname/projectname.git失败,显示:

ssh_exchange_identification: read: Connection reset by peer fatal:Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.



我已经在Github中创建了存储库。

但是git clone https://github.com/myname/projectname.git成功了。

那么,这是否意味着我的网络仅支持https而不是ssh?还是我需要说些什么?

我在win7中使用Git bash,我的git版本是2.9.0。我的位置是上海中国。我正在使用VPN,可以访问youtube,google等。

最佳答案

首先,请确保您的ssh GitHub setup is complete(即您的~/.ssh/id_rsa.pub公钥已注册到您的GitHub帐户)

然后,确保使用最新的git(On Windows: 2.9.2)

可能是防火墙问题(根据您所在的国家/地区,可能是本地问题,也可能是远程问题:请参阅this answer as an example)
切换到https网址可能是一个不错的解决方法。

关于git - 对于git,如何知道网络是否支持ssh或https?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38429492/

相关文章:

windows - 当我在Windows 10上的git bash中运行git-gui时,我得到 "line 3: exec: wish: not found"

git - 将 git post-commit 钩子(Hook)应用到所有当前和 future 的存储库

git - 当您已经拥有主人时,如何从 repo 中 fork 出一个新分支?

git - 如何使用带有 git 命令的 travis merge 到另一个分支?

ssh - Drools Workbench通过SSH访问存储库

django - 来自python的svn调用在ubuntu box上不起作用

git - 从 Git 中删除文件 - 困惑

git - 智能 : Force read-only when on master branch

ios - 如何对 Cocoapods 安装进行 nuke 并从 Github master 开始

linux - 通过一些脚本在多台机器的目录下创建一个文件?