Skip to content

Instantly share code, notes, and snippets.

@sbwtw
Forked from bynil/config-git-proxy.txt
Created November 28, 2018 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbwtw/388b1fd820199379876242073b1ea2a4 to your computer and use it in GitHub Desktop.
Save sbwtw/388b1fd820199379876242073b1ea2a4 to your computer and use it in GitHub Desktop.
Use git over socks5 proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
[core]
gitproxy=/YOUR PATH/gitproxy.sh
# For http(s)://
[http]
proxy=socks5://127.0.0.1:1080
[https]
proxy=socks5://127.0.0.1:1080
3. Edit your /etc/ssh/ssh_config to change global setting (or ~/.ssh/config for special host)
# For ssh://
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment