168

Git设置代理克隆Github代码

http方式克隆

git clone -c https.proxy="127.0.0.1:7890" <仓库地址>

ssh方式克隆

编辑配置文件~/.ssh/config,加入如下配置

Host github.com
        HostName github.com
        User git
        ServerAliveInterval 60
        # 走 HTTP 代理
        ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=7890
        # 走 socks5 代理 linux
        #ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
        # 走 socks5 代理 windows
        #ProxyCommand connect -S 127.0.0.1:7890 %h %p

然后,直接克隆代码即可

文章作者:DOTATONG
发布日期:2024-08-19
# git

评论

暂无

添加新评论