Slow speed on git clone

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/wangbingfengf98/article/details/98663974

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 [email protected]: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/

猜你喜欢

转载自blog.csdn.net/wangbingfengf98/article/details/98663974
今日推荐