我正在使用新的网络。但是,当我尝试从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/