git pull 连接ssh失败
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-02 09:37:42
[Git讨论组]

$ 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码已经绑定。

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

全部回复(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...

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号