報(bào)錯(cuò)
> git pull --tags origin main
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.
分析
登錄了一下github網(wǎng)站,發(fā)現(xiàn)可以訪問:
但是,ping了一下github,發(fā)現(xiàn)請(qǐng)求超時(shí)。
git、命令行都無法正確解析域名,但瀏覽器可以,有些奇怪。文章來源:http://www.zghlxwxcb.cn/news/detail-802040.html
但可以判斷,確實(shí)是網(wǎng)絡(luò)域名解析出現(xiàn)了問題,下面將采用手動(dòng)修改hosts文件的方式解決。文章來源地址http://www.zghlxwxcb.cn/news/detail-802040.html
解決
- 打開網(wǎng)站:https://www.ipaddress.com/ip-lookup,并在紅框中輸入域名,查詢域名對(duì)應(yīng)的IP地址;
- 點(diǎn)擊lookup;
- 得到對(duì)應(yīng)區(qū)域的github主機(jī)名;
- 查詢?nèi)缦聝蓚€(gè)主機(jī)名:
140.82.113.3 github.com
146.75.77.194 github.global.ssl.fastly.net
- 補(bǔ)充到
C:\Windows\System32\drivers\etc\hosts
文件的末尾,該文件不可編輯,可以復(fù)制到桌面,然后再復(fù)制回去實(shí)現(xiàn)替換。 - 測試:
到了這里,關(guān)于ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote……的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!