There are three tricks I try for a quick cloning:
- update hosts file
a. add
192.30.253.112 github.com
192.30.253.113 github.com
151.101.185.194 github.global.ssl.fastly.net
to your /etc/hosts
check github.com ip at ipaddress.
b. then run
$ sudo killall -HUP mDNSResponder
update dns
this do work for me on the second day.
- Kill the command and try again. Do this a few times, see if you can get a faster connection. This works most of the times.
-
Fetch only the latest revision first and then fetch the rest:
$ git clone --depth=1 git@github.com:wangbingfeng/regular-investing-in-box.git
$ cd regular-investing-in-box
$ git fetch --unshallow
note: https link is slightly faster than ssh connection
references:
1. https://www.jianshu.com/p/8cdc11ba5ff2
2. https://codeyarns.com/2016/01/12/slow-speed-on-git-clone/