korechi’s diary

とあるVR/ARエンジニアのブログ

proxy配下でgitを使ったinstallコマンドがつかえない時の解決法

まず、最も簡単な解決法としては、

$ vim ~/.gitconfig

とgitconfigを開き

[http]
        proxy = http://proxy.example.com:8080
[https]
        proxy = http://proxy.example.com:8080

こう書いて保存する。
これでcloneはできるはず。

$ git config --list

で設定を確認できる。

これでgit cloneはできるはずだが、luarocksのように間接的にgit cloneを行う場合gitにアクセスできない場合がある。

これは、clone先のurlが

http://github.com/**

ではなく

git://github.com/**

となっているためである。(自分の場合はそうだった)

そのため、gitconfitに

[url "https://"]
        insteadOf = git://

と書き、すべてhttps://からcloneするようにすれば解決した。