httpプロキシ経由でgitリポジトリをhttpsプロトコルから取得する時の注意(Ubuntu)
proxy経由で https://git-wip-us.apache.org/repos/asf/deltacloud.git
をcloneしようとして失敗した。
以下の記事によると、Ubuntuに標準でインストールされているlibcurl3-gnutlsの不具合らしい?
libcurl3-gnutls-7.21からlibcurl3-gnutls-7.22にバージョンアップすることでgit cloneに成功しました。
http://stackoverflow.com/questions/8403792/git-behind-proxy-remote-head-refers-to-nonexistent-ref-unable-to-checkout
失敗した時に表示されるエラーはこのような感じ
$ git clone https://git-wip-us.apache.org/repos/asf/deltacloud.git Cloning into deltacloud... warning: remote HEAD refers to nonexistent ref, unable to checkout.
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
ここから必要なlibp11-kit0,libgnutls26,libcurl3-gnutlsをダウンロード。
# dpkg -i libp11-kit0_0.10-1_amd64.deb libgnutls26_2.12.14-5ubuntu2_amd64.deb libcurl3-gnutls_7.22.0-3ubuntu2_amd64.deb
でインストールします。
git cloneする前に、gitでプロキシの設定を行なって下さい。
$ git config --global http.proxy "http://[proxy ip]:[port]"
あとは、通常のgit cloneを実行します。
$ git clone https://git-wip-us.apache.org/repos/asf/deltacloud.git
ちなみに、corkscrewなどの設定を行なって、gitプロトコル経由でcloneしてくる場合には必要ない対応です。
今回試した環境はUbuntu 11.10の64bit版です。
記事中に示したサイトでは11.04でも同様に発生するようです。