解决github能正常访问,但是ping不通,也无法进行git操作的问题

打开github动态地址,查询github的动态IP地址。

查询网址如下:

What Is My IP Address - What Is My IP Location

以管理员身份运行cmd,切换到C:\Windows\System32\drivers\etc文件夹,然后输入notepad hosts,打开hosts文件后,

 

在hosts文件的最后添加如下代码:

140.82.112.3 github.com

再ping github.com就能ping通了。

posted on 2025-02-08 22:43  一杯明月  阅读(740)  评论(0)    收藏  举报