git pull 连接ssh失败
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-02 09:37:42
0
3
738

$ git pull project develop
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

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

project中有代码更新,但是连接失败怎么解决,github中ssh码已经绑定。

曾经蜡笔没有小新
曾经蜡笔没有小新

Antworte allen(3)
小葫芦

首先确认是不是网络的问题,网络不好的话国内连Github会经常超时。

不是网络问题的话,如果安装了Github desktop可以先打开下,然后在git pull

大家讲道理

github国内时常抽风,多试试就可以了。
或者你可以购买VPN,挂VPN进行操作。

我想大声告诉你

官方帮助给的解决方式是使用 ssh 443端口:

1,先测试可用性

ssh -T -p 443 git@ssh.github.com

提示如下证明可用

Hi username! You’ve successfully authenticated, but GitHub does not
provide shell access.

2,然后编辑~/.ssh/config 文件,如果没有config文件的话就直接vim ~/.ssh/config加入如下内容

Host github.com
Hostname ssh.github.com
Port 443

再次测试

ssh -T git@github.com

提示如下即可用

Hi username! You’ve successfully authenticated, but GitHub does not provide shell access.

3,参考github官方帮助:
https://help.github.com/artic...

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!