Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GitHub ssh access via HTTP Proxy
host github.com
user git
hostname ssh.github.com
port 443
proxycommand socat - PROXY:<hostname>:%h:%p,proxyport=<port>
@rbenaley

This comment has been minimized.

Copy link
Owner Author

@rbenaley rbenaley commented Apr 27, 2012

Example of usage:

$ git clone git@github.com:rbenaley/erlang_samples
Initialized empty Git repository in /home/rbenaley/erlang_samples/.git/
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 15 (delta 2), reused 14 (delta 1)
Receiving objects: 100% (15/15), done.
Resolving deltas: 100% (2/2), done.

@rbenaley

This comment has been minimized.

Copy link
Owner Author

@rbenaley rbenaley commented Apr 27, 2012

Also works:

$ git clone github.com:rbenaley/erlang_samples
Initialized empty Git repository in /home/mnemonic/erlang_samples/.git/
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 15 (delta 2), reused 14 (delta 1)
Receiving objects: 100% (15/15), done.
Resolving deltas: 100% (2/2), done.

@hongbosun77

This comment has been minimized.

Copy link

@hongbosun77 hongbosun77 commented Nov 14, 2018

git clone git@github.com:rbenaley/erlang_samples

Cloning into 'erlang_samples'...
/bin/bash: -c: line 0: syntax error near unexpected token newline' /bin/bash: -c: line 0: exec socat - PROXY::ssh.github.com:443,proxyport='
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@regalstreak

This comment has been minimized.

Copy link

@regalstreak regalstreak commented Mar 29, 2019

Works perfectly. Thanks.
Just put the file contents in ~/.ssh/config and not ssh_config

@liuwenyao

This comment has been minimized.

Copy link

@liuwenyao liuwenyao commented Mar 15, 2020

Very useful, especially for developers behind Gfw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.