1. 修改本地hosts文件
windows系统的hosts文件的位置如下:C:\Windows\System32\drivers\etc\hosts
mac/linux系统的hosts文件的位置如下:/etc/hosts
2. 增加http://github.global.ssl.fastly.net和http://github.com的映射
获取Github相关网站的ip
访问https://www.ipaddress.com,在搜索框“IP Address,Domain or Hostname”中
分别输入github.global.ssl.fastly.net和github.com,查询ip地址
下面是我在“C:\Windows\System32\drivers\etc\hosts”中添加的配置
140.82.113.4 github.com
199.232.69.194 github.global.ssl.fastly.net
到此,大功告成了。
要是不行的话就在命令行(Window+R中输入cmd打开)中输入ipconfig/flushdns即可