Skip to content

Instantly share code, notes, and snippets.

@Carolusian
Forked from larryli/GIT_SSH_COMMAND.sh
Created November 27, 2020 02:17
Show Gist options
  • Save Carolusian/03644aafdfa81c0bfae8d121eed6a966 to your computer and use it in GitHub Desktop.
Save Carolusian/03644aafdfa81c0bfae8d121eed6a966 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