Skip to content

Instantly share code, notes, and snippets.

@leoleozhu
Last active June 18, 2025 08:45
Show Gist options
  • Select an option

  • Save leoleozhu/5538936 to your computer and use it in GitHub Desktop.

Select an option

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 git@github.com:username/project.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment