LoginSignup
16
17

More than 5 years have passed since last update.

Proxy環境下でのGit for Windows設定

Last updated at Posted at 2015-11-11

Android Studioを会社のWindowsで使いたかったので、入れてみたところ、Cygwinに適当に入れていたgitでは動作しなくて、調べてみました。
なんとなくGit for Windowsを入れたので、Cygwinのgitがどうして動かなかったかは調べていません。多分下記と同じ設定をすれば動くのでしょう。

OS : Windows 7
Git : Git-2.6.3-64-bit.exe

まずはProxyを設定する

git config --global http.proxy http://proxy.xxx.co.jp:8080
git config --global https.proxy http://proxy.xxx.co.jp:8080
git config --global url."https://".insteadOf git://

.gitconfigを編集しても同様。
.gitconfigはユーザディレクトリ配下にある

参考サイト
http://qiita.com/HibiU1/items/76ac6edb43cffd9da081

試しにbitbucket.orgに登録している自分のソースをgit cloneしてみると、下記のようなエラーが出た。
error setting certificate verify locations

Gir for Windowsインストール時にデフォルトで入るca-bundle.trust.crtを指定するため、.gitconfigに下記を追加

[http]
        sslcainfo = C:/Users/[UserName]/AppData/Local/Programs/Git/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt

参考サイト
http://promamo.com/?p=1680

16
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
17