git_clone提速

此文转载自:https://blog.csdn.net/havedoor/article/details/83350768

1. host重定向

通过http://tool.chinaz.com/dns寻找github.com最高效地址,就是TTL最短的IP地址。

  • 寻找github.comTTL最短的IP地址

  • 寻找github.global.ssl.fastly.netTTL最短的IP地址

  • 配置hosts

    vim /etc/hosts
    13.229.188.59 github.com
    31.13.83.8    github.global.ssl.fastly.net

2. 通过码云中转

在码云上新建一个项目,然后选“导入已有项目”,把github上要clone的工程放进去,一般需要十几分钟完成创建。

3. 通过代理方式

这种方式需要有VPN代理,本人使用的是Lantern收费版的,感觉甚是不错。

  • 查看自己VPNproxy端口

    • 点击Lantern的显示蓝灯,如下所示:
    • 弹出浏览器页面,在地址栏可以看到代理端口,如下所示:
  • 设置代理(只针对github

git config --global http.http://github.com.proxy 127.0.0.1:51181
git config --global https.https://github.com.proxy 127.0.0.1:51181
  • 删除代理
git config --global --unset http.http://github.com.proxy
git config --global --unset https.https://github.com.proxy
  • 查看Git全局配置
git config --global --list



编程技巧      编程技巧

本博客所有文章除特别声明外,均采用 CC BY-SA 3.0协议 。转载请注明出处!