Skip to content

Instantly share code, notes, and snippets.

@patlachance
Forked from larryli/GIT_SSH_COMMAND.sh
Created August 16, 2018 14:16
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 patlachance/f2807333a8e4a040523f4d0e2de01c85 to your computer and use it in GitHub Desktop.
Save patlachance/f2807333a8e4a040523f4d0e2de01c85 to your computer and use it in GitHub Desktop.
Git ssh socks proxy
#!/bin/sh
export GIT_SSH_COMMAND='ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git config --global core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git clone -c=core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"' git@github.com:larryli/ipv4.git
git config core.sshCommand 'ssh -o ProxyCommand="connect -S 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