Mitigation plan for the slow speed of GitHub pulling warehouses in the domestic environment

Step 1: Open the following two URLs in the browser and find the corresponding IP address:

  1. http://github.com.ipaddress.com/
  2. http://github.global.ssl.fastly.net.ipaddress.com/

Suppose the corresponding IP addresses are 140.82.xx.xxx and 199.232.yy.yyy respectively

 

Step 2: Edit the hosts file

sudo vim /etc/hosts

Add the following two lines:

140.82.xx.xxx  github.com
199.232.yy.yyy github.global.ssl.fastly.net

 

Step 3: Update the DNS cache (Mac users only)

Linux users please ignore this step.

sudo dscacheutil -flushcache

That's it!

Now, you can try to pull the code from GitHub again

Guess you like

Origin blog.csdn.net/whuzhang16/article/details/111561428