解决无法Ping通Github

来源:互联网 发布:java 高效率排序 编辑:程序博客网 时间:2024/04/28 05:41

今天在push的时候发现报错,如下:

$ git push -u origin masterssh: Could not resolve hostname github.com: Temporary failure in name resolutionfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

找了很久原因,首先ctrl + r 输入cmd ,ping一下github.com,如图

这里写图片描述
Ping不通,这时候,只需要在host文件里做些修改就可以,首先,定位到路径

C:\Windows\System32\drivers\etc 

找到host文件,右键-属性-安全-编辑,选中当前电脑登录的用户,给自己最高权限,确认。
这里写图片描述

然后用记事本打开,在最后一行加:

192.30.253.113    github.com192.30.252.131 github.com185.31.16.185 github.global.ssl.fastly.net74.125.237.1 dl-ssl.google.com173.194.127.200 groups.google.com192.30.252.131 github.com185.31.16.185 github.global.ssl.fastly.net74.125.128.95 ajax.googleapis.com

保存,再ping,发现速度杠杠的
这里写图片描述

1 0