美文网首页知识总结程序员Git使用
通过 SS 代理加快 GitHub Clone 速度

通过 SS 代理加快 GitHub Clone 速度

作者: X先生说 | 来源:发表于2017-04-16 17:15 被阅读460次

前言

平时我们 Clone GitHub 的仓库的时候,会发现速度极慢,只有几 KB/s,在克隆较大仓库的时候,更是可能要一天时间,这对于开发者而言是不能接受的,故这里教大家一个提速的方法,通过 SS 代理加快 GitHub Clone 速度。
根据自己 Clone 仓库的方式选择下面对应的处理方式。

HTTP 或 HTTPS 方式 Clone

1、打开自己的 SS 代理
2、通过命令行跑以下命令,注意这里只代理了 GitHub 域名

git config --global http.http://github.com.proxy http://127.0.0.1:1080
git config --global https.https://github.com.proxy https://127.0.0.1:1080

3、如果要取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

SSH 方式 Clone

在~/.ssh/config中配置代理:

Host github.com
  Hostname github.com
  ProxyCommand connect -S 127.0.0.1:1080 %h %p
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa

然后就可以享受快速克隆的便捷啦!

Enjoy it !

如果觉得文章对你有用,可以赞助我喝杯咖啡~

版权声明

转载请注明作者和文章出处
作者: 小鱼儿
首发于 http://www.jianshu.com/p/8e9af3a1b231

相关文章

网友评论

    本文标题:通过 SS 代理加快 GitHub Clone 速度

    本文链接:https://www.haomeiwen.com/subject/zqiaattx.html