Speeding up the GitHub Clone

Series: Git and Github

Speeding up the GitHub Clone

We are going to use the method of adding the IP addresses to the hosts, so it saves our time for the domain name resolution.

In the terminal, we write (the root user permission is a must),

$ sudo vi /etc/hosts

in the vim editor, we add the following resolutions to the hosts file,

13.229.188.59 github.com
13.250.177.223 github.com
151.101.196.133 assets-cdn.github.com
151.101.24.133 assets-cdn.github.com
151.101.77.194 github.global.ssl.fastly.net
151.101.229.194 github.global.ssl.fastly.net
185.31.16.1185 github.global.ssl.fastly.net
74.125.237.1 dl-ssl.google.com
173.194.127.200 groups.google.com
192.30.252.131 github.com
185.31.16.185 github.global.ssl.fastly.net
74.125.128.95 ajax.googleleapis.com
151.101.192.133 raw.githubusercontent.com

save and quit the vim editor. Then clear the cache by,

$ sudo dscacheutil -flushcache

and this will update the new resolutions in the hosts file. Then we are expected to see a fast speed of git clone, especially in China. This method is valid whether you are using or not using a proxy.