git命令無法遠程連接github,並且命令行ping github.com時出現請求超時的解決方法

利用Git命令進行提交本地項目時,程序報出下面的錯誤:

$ git pull
ssh: Could not resolve hostname github,com: Name or service not known
fatal: Could not read from remote repository.

用系統命令行進行 ping的時候,請求超時:

在這裏插入圖片描述

解決方法:修改hosts文件:

可能之前已經修改過你的hosts文件已經修復好了,但fq之後依然會出現報錯;

hots文件的地址在:

C:\Windows\System32\drivers\etc

打開hosts文件,在末尾處添加:

	
192.30.253.112 github.com
151.101.88.249 github.global.ssl.fastly.net

或者

92.30.253.113    github.com
192.30.252.131 github.com
185.31.16.185 github.global.ssl.fastly.net
74.125.237.1 dl-ssl.google.com
173.194.127.200 groups.google.com
192.30.252.131 github.com
185.31.16.185 github.global.ssl.fastly.net
74.125.128.95 ajax.googleapis.com

就可以正常使用了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章