參考:https://gist.github.com/laispace/666dd7b27e9116faece6
前提是你本地有 socks5 代理。
上面參考地址作者提供的配置無效,但是后面回復中的配置有效:
1
2
|
git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080' |
還有針對 github.com 的單獨配置:
1
2
3
4
|
#只對github.com git config --global http.https: //github.com.proxy socks5://127.0.0.1:1080 #取消代理 git config --global --unset http.https: //github.com.proxy) |
直接使用 socks5 的速度很快,近百兆的項目能在短時間內下載完。
測試:
1
2
3
4
5
6
7
8
|
$ git clone https: //github.com/abel533/mybatis-3.git cloning into 'mybatis-3' ... remote: enumerating objects: 20 , done. remote: counting objects: 100 % ( 20 / 20 ), done. remote: compressing objects: 100 % ( 13 / 13 ), done. remote: total 209581 (delta 0 ), reused 12 (delta 0 ), pack-reused 209561 receiving objects: 100 % ( 209581 / 209581 ), 72.32 mib | 405.00 kib/s, done. resolving deltas: 100 % ( 176933 / 176933 ), done. |
速度在 405.00 kib/s,已經很快了。
曾經為此寫過的一個小應用可以關閉了。
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作具有一定的參考學習價值,謝謝大家對服務器之家的支持。如果你想了解更多相關內容請查看下面相關鏈接
原文鏈接:https://blog.csdn.net/isea533/article/details/84748009