问题描述
$ git clone git@github.com:MaugerWu/MaugerWu.github.io.git
Cloning into 'MaugerWu.github.io'...
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 rigths
and the repository exists.
问题解决
- 我的解决办法是将
git@
换成 https@
,将链接 $ git clone git@github.com:MaugerWu/MaugerWu.github.io.git
换成了 $ git clone https://github.com/MaugerWu/MaugerWu.github.io.git
,然后就可以了。
- 测试连接
- 首先打开
git Bash
,输入命令 ssh -T git@github.com
测试看看是否连接成功。成功会提示 Hi XXX! You've successfully authenticated, but Github does not peovide shell access.
- 连接超时会提示
ssh:connect to host github.com port 22:Connect timed out
- 参考:https://cloud.tencent.com/developer/article/1019718