Skip to content

Instantly share code, notes, and snippets.

@glenrobertson
Created August 30, 2012 22:15
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save glenrobertson/3542771 to your computer and use it in GitHub Desktop.
git access behind http proxy

I shouldn't have to do this shit..

  1. Install corkscrew

  2. Setup corkscrew auth file

     echo your_proxy_username:your_proxy_password > ~/.corkscrew_auth
    
  3. Add to ~/.ssh/config

     Host gitproxy
         User git
         Hostname ssh.github.com
         Port 443
         ProxyCommand /usr/local/bin/corkscrew dnzwgpx2 80 %h %p ~/.corkscrew_auth
         IdentityFile ~/.ssh/id_rsa
    
  4. Add to .git/config for your git repo

     [remote "originpx"]
         url = ssh://gitproxy/your_username/your_repo.git
         fetch = +refs/heads/*:refs/remotes/origin/*
    
  5. You should be able to now do this:

     git clone git@gitproxy:your_username/your_repo.git
    

Thanks to http://www.wetware.co.nz/2010/03/cant-access-github-behind-proxy-or-firewall/ for the inspiration

@alexromanyuk
Copy link

It's helped me. Thank you, Glen!

@SamJoan
Copy link

SamJoan commented Apr 17, 2013

Glen always saving the day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment