美文网首页
git代理配置

git代理配置

作者: helphi | 来源:发表于2022-06-30 11:41 被阅读0次

git http 使用 http proxy

git config http.proxy "http://127.0.0.1:1080"
git config https.proxy "http://127.0.0.1:1080"

git http 使用 https proxy

git config http.proxy "https://127.0.0.1:1080"
git config https.proxy "https://127.0.0.1:1080"
# 自签名https证书需要导入到操作系统中先

git http 使用 socks proxy

git config http.proxy "socks5://127.0.0.1:1080"
git config https.proxy "socks5://127.0.0.1:1080"

git ssh 使用 http proxy

需要安装socat指令

vim ~/.ssh/config
Host github.com
HostName github.com
User git
ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=1080
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa

git ssh 使用 https proxy

需要安装proxytunnel指令

vim ~/.ssh/config
Host github.com
HostName github.com
User git
ProxyCommand proxytunnel -q -E -p 127.0.0.1:1080 -d %h:%p
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa

git ssh 使用 socks proxy

需要安装nc指令

vim ~/.ssh/config
Host github.com
HostName github.com
User git
ProxyCommand nc -v -x 127.0.0.1:1080 %h %p
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa

相关文章

网友评论

      本文标题:git代理配置

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