yaeda.github.io

Git Protocol Access Over Http Proxy

(over 9 years ago)

Git protocol(git://) is the fastest way to access to a git repository. However, firewall sometime prevent this protocol.

Recently we can use ssh protocol instead of git protocol to the Github repositories. However many other git repositories don’t have such alternatives.

In that case, ‘corkscrew’ enable you to use git protocol over http proxy.

Install corkscrew.

sudo apt-get install corkscrew

Create a script called ‘git-proxy.sh’.

#!/bin/sh
corkscrew <proxy host> <proxy port> $1 $2

Setup environment variable called GIT_PROXY_COMMAND.

chmod 755 /path/to/git-proxy.sh
export GIT_PROXY_COMMAND=/path/to/git-proxy.sh

Another approach is using ‘socat’. I havn’t yet tried that so refer to the following links, please.