Clone a project, but install dependencies fail anyway, open Github sometimes progress, most of the time not access.

Find the hosts file in /private/etc, modify the file, and refresh the DNS.

1. Find /private/etc. The hosts file cannot be modified directly. You need to make a copy of the file and overwrite the original one.

2. Locate the Github domain name and add it to the hosts file.

1. The first through the url github.com.ipaddress.com/www.github…. Query the IP address of github.com

Such as:

140.82.113.4 github.com

 199.232.69.194 github.global.ssl.fastly.net 

185.199.108.153 assets-cdn.github.com 

185.199.110.153 assets-cdn.github.com 

185.199.111.153 assets-cdn.github.com

As shown in figure:

3. Refresh DNS

sudo killall -HUP mDNSResponder

Refer to www.lisonglin.com/news/149.ht…