Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Jimmy-Xu/5790976af09d9f37a8518d2264f81966 to your computer and use it in GitHub Desktop.
Save Jimmy-Xu/5790976af09d9f37a8518d2264f81966 to your computer and use it in GitHub Desktop.
Using github through SSH tunnel
# Prerequisites: netcat-openbsd (BSD version of netcat)
$ ssh -fND 127.0.0.1:8081 user@<your-vps>
$ git config --global url."https://github".insteadOf git://github
$ git config --global http.proxy 'socks5://127.0.0.1:8081'
$ echo -e 'Host github.com\nProxyCommand nc -x 127.0.0.1:8081 %h %p' >> ~/.ssh/config

Alternative solutions:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment