以前使用Git都是下一些小文件,网速完全没察觉,今天下一个0.5G的项目才发现这个git clone的速度真的是太慢了。

上网查找了一些方式,主要有三种,第三种速度最快,如果下载上百M的项目时间又紧迫的话建议采用。

 

    不用clone整个记录,只需要clone最近的一次commit,减少下载量,于是有“加速效果”。

     

     git clone --depth=1 https://github.com/XXX.git

 

方法二、去除网速限制

    这是大多数人的解法

    步骤1:查ip:

      github.global.ssl.fastly.net
      github.com
   步骤2:改文件:

    Windows上的hosts文件路径在C:\Windows\System32\drivers\etc\hosts

    Linux的hosts文件路径在:sudo vim /etc/hosts

    末尾添加

      XXX.XXX.XXX.XXX github.global-ssl.fastly.net
      XXX.XXX.XXX.XXX github.com
    步骤3:刷新DNS
     Winodws:CMD:ipconfig /flushdns
     Linux:sudo /etc/init.d/networking restart

 

方式三、借助第三方网站 https://gitee.com

参考:https://blog.csdn.net/xy_zhangchn/article/details/81558144

这种方式网速极快,如下

Git Clone加速三种方式

 不过好像下载下来的文件有点问题。

 

 

相关文章:

  • 2021-06-29
  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-25
  • 2021-08-29
  • 2021-11-21
猜你喜欢
  • 2022-01-16
  • 2021-09-05
  • 2022-01-20
  • 2021-07-31
  • 2021-07-05
  • 2021-05-21
  • 2022-12-23
相关资源
相似解决方案