Skip to content

Instantly share code, notes, and snippets.

@zfb132
Forked from chenshengzhi/git_ssh_proxy.md
Created June 16, 2022 02:52
Show Gist options
  • Save zfb132/79383fdb7884d8f41e3a11ba8c07b544 to your computer and use it in GitHub Desktop.
Save zfb132/79383fdb7884d8f41e3a11ba8c07b544 to your computer and use it in GitHub Desktop.
git ssh 代理设置

仅为 GitHub 设置代理

git 代理

设置 git config --global http.https://git.521000.best.proxy socks5://127.0.0.1:1086
设置完成后, ~/.gitconfig 文件中会增加以下条目:

[http "https://github.com"]
    proxy = socks5://127.0.0.1:1086
ssh 代理

修改 ~/.ssh/config 文件

Host github.com
    User git
    ProxyCommand nc -v -x 127.0.0.1:1086 %h %p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment