using GIT behind proxy

GIT is another software used for version control as SVN or CVS. Today when I was at gym Shreyank requested me to find out a possible solution for using GIT as he saw what I had posted earlier to use SVN and Pidgin. He was really very happy to see Pidgin working.

I came back then I thought I should give it a try too. I visited the LDTP site. There I saw a link for using git behind proxy. I dont know how it worked for me. I simply noticed that there was a simple change of protocols while using proxy, git:// was changed to http://.This is what I used to download the source of LDTP

$git clone http://anongit.freedesktop.org/git/ldtp/ldtp.git

I tried and bang! it was working for me. I had done only the usual proxy setting form yast, it sets up the http_proxy Environment variable. Check if it is set for you.

$echo $http_proxy

If the output is not “http://10.0.0.1:3128″ then the proxy setting is not done for you. Do this

$export http_proxy=”http://10.0.0.1:3128”

It should work for you also.

Cheers 🙂


Posted

in

by

Comments

17 responses to “using GIT behind proxy”

  1. KingTrast Avatar

    Thanks for the information. Your blog is added to your bookmarks. Develop.
    Your reader.

  2. Karthik Avatar
    Karthik

    Your guide will not work in 2 cases

    a)If the repo has no webview enabled.. ie. NO HTTP
    b)If the proxy blocks the port used by git like ours does 🙂

  3. Amit Avatar
    Amit

    Thanks Roshan, exporting the env variable “http_proxy” worked for me 🙂

  4. artou Avatar
    artou

    Thank you very much!

  5. […] I decided to change my search query to Google, and guess what? I found the answer!! Thanks to link and this […]

  6. Anonymous Avatar
    Anonymous

    Clearly as Karthik mentioned, your solution wouldn’t work if there is no web view of the repo through http protocol.

  7. Wildan Maulana Avatar

    @Karthik was right ..

    i can use git here .. 🙁

  8. Dominik Avatar
    Dominik

    git honors the http_proxy env variable and allows to connect via it. if the proxy blocks ports other than 80 (www), you might have success with the git HTTP protocol (if the server has that setup).

    1. Roshan Singh Avatar

      Never used this, will see if it works 🙂

  9. Zubin Mithra Avatar

    git can use 3 protocols ; http, git or ssh. outgoing http traffic is not blocked by most proxy servers, thats why it worked.

  10. nitin Avatar
    nitin

    Export of http_proxy works, but only if no user authentication is required. What to do if user authentication is required on my proxy server??

    1. Roshan Singh Avatar

      you should use
      $export http_proxy=http://user:pass@host:port
      like
      $export http_proxy=http://roshansingh:secretpassword@10.0.01:3128

  11. […] using GIT behind proxy This entry was posted in sysadmin and tagged Desarrollo. Bookmark the permalink. ← FTP auto-login […]

  12. Giovanni Dall'Olio Avatar

    There is a typo in the article:

    “””If the output is not “http;//10.0.0.1:3128″ then the proxy setting is not done for you. Do this”””

    http;// should be http://

    1. Roshan Singh Avatar

      Thanks for notifying 🙂

  13. Arun Abraham Avatar
    Arun Abraham

    Thanks a lot… this helped me a lot while i was using this script (https://raw.github.com/fonnesbeck/ScipySuperpack/master/install_superpack.sh) to install scipy… 🙂

Leave a Reply to Using Git behind Proxy « Stand on the shoulders of giants Cancel reply

Your email address will not be published. Required fields are marked *