Slow speed on git clone

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值