1.报错信息
$ 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.
2.解决办法。
将 git@ 换成 https@,将链接
$ git clone git@github.com:xxx/xxx.git
换成了
$ git clone https://github.com/xxx/xxx.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