問題描述
$ 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