Skip to content

Instantly share code, notes, and snippets.

@leoleozhu
Last active December 21, 2016 15:48
Show Gist options
  • Save leoleozhu/5538936 to your computer and use it in GitHub Desktop.
Save leoleozhu/5538936 to your computer and use it in GitHub Desktop.
use Git with proxy

install socat

sudo apt-get install socat

edit ~/.ssh/config

host github.com
    proxycommand socat - PROXY:localhost:%h:%p,proxyport=8080

###If you want to use SOCKS proxy, edit it like this. host bitbucket.org ProxyCommand socat - SOCKS:localhost:%h:%p,socksport=7070

For detailed information, please see the man page of socat

clone repo

git clone [email protected]:username/project.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment