github clone加速

我的方法是FQ方式, 本机采取的socks5的方式可行

全局git 采取代理模式

# socks5 协议,1080端口  
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

#http协议,1081端口 
git config --global http.proxy http://127.0.0.1:1081
git config --global https.proxy https://127.0.0.1:1081

国内git仓库与github仓库进行git分开

# socks5 协议,1080端口 
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
git config --global https.https://github.com.proxy socks5://127.0.0.1:1080

或者

# http协议,1081端口 
git config --global http.https://github.com.proxy https://127.0.0.1:1081
git config --global https.https://github.com.proxy https://127.0.0.1:1081

~/.gitconfig

[user]
        email [email protected]
[use]
        name = xxx
[credential]
        helper = store
[core]
        editor = vim
        compression = -1
[http]
        postBuffer = 1048576000

[http "https://github.com"]
        proxy = socks5://127.0.0.1:1080
[https "https://github.com"]
        proxy = socks5://127.0.0.1:1080

参考: git clone 加速

你可能感兴趣的:(【Ubuntu】)