git behind proxy: remote HEAD refers to nonexistent ref, unable to checkout

后端 未结 4 1794
孤街浪徒
孤街浪徒 2021-02-01 06:30

When trying to clone ANY repository via https from github, we get:

git clone https://github.com/rails/rails.git
Cloning into rails...
remote HEAD refers to nonex         


        
相关标签:
4条回答
  • 2021-02-01 06:54

    A workaround found at the linked Ubuntu bug:

    add the following to ~/.gitconfig or /etc/gitconfig

    # Workaround for bug when using SSL and HTTP proxy (LP #940431)
    [url "http://"]
     insteadOf = "https://"
    

    No longer necessary starting with 12.04.

    0 讨论(0)
  • 2021-02-01 06:59

    the packages noted above can be found here:

    • http://packages.ubuntu.com/en/precise/amd64/libp11-kit0/download
    • http://packages.ubuntu.com/en/precise/amd64/libgnutls26/download
    • http://packages.ubuntu.com/en/precise/amd64/libcurl3-gnutls/download

    I used these versions and was able to use git behind a proxy without issue:

    $ sudo dpkg -i libp11-kit0_0.10-1_amd64.deb libgnutls26_2.12.14-5ubuntu2_amd64.deb libcurl3-gnutls_7.22.0-3ubuntu2_amd64.deb
    
    0 讨论(0)
  • 2021-02-01 07:02

    I've stumbled across the solution to this problem via this post:

    http://comments.gmane.org/gmane.comp.version-control.git/185459

    The issue is apparently a bug in the libcurl version installed in Ubuntu server 11.04. Simply running apt-get install libcurl3-gnutls was not sufficient to solve the problem since it simply reported the latest version was already installed.

    To solve the problem, I had to manually install the latest libcurl3-gnutls, and two dependencies, as seen below (obviously, after having downloaded them to my system first):

    sudo dpkg -i libp11-kit0_0.6-0ubuntu2_amd64.deb
    sudo dpkg -i libgnutls26_2.12.14-3_amd64.deb
    sudo dpkg -i libcurl3-gnutls_7.22.0-3ubuntu1_amd64.deb
    

    Hope this helps someone.

    0 讨论(0)
  • 2021-02-01 07:06

    Another simple solution would be:

    regressing libcurl3 from 7.21.0 to 7.19.5.

    Download it from here:

    amd64: http://launchpadlibrarian.net/30289951/libcurl3-gnutls_7.19.5-1ubuntu2_amd64.deb

    i386: http://launchpadlibrarian.net/30287711/libcurl3-gnutls_7.19.5-1ubuntu2_i386.deb

    0 讨论(0)
提交回复
热议问题