Skip to content

Instantly share code, notes, and snippets.

@nojaja
Created July 18, 2019 01:58
Show Gist options
  • Select an option

  • Save nojaja/1fa7bd0048fc2fb8afb7604513002480 to your computer and use it in GitHub Desktop.

Select an option

Save nojaja/1fa7bd0048fc2fb8afb7604513002480 to your computer and use it in GitHub Desktop.
git導入時に設定する事

git導入時に設定する事をまとめておく

pushでusername/passwordを省略する

~/.netrc にユーザ名/パスワードを書く

こんな感じで自分の$HOME直下に.netrcファイルを作成する。
Windowsの場合は%USERPROFILE%配下に_netrcファイルを作成する。

machine github.com
login syokenz
password xxxxxxx

もし、後述する2つ目の方法でURLにユーザ名を埋め込んでいた場合、パスワードを聞かれるので注意。その場合、何も入力せずにリターンすれば、~/.netrcの設定を見てくれる。

proxyの設定

git config --global http.proxy "myproxy:8080"
git config --global https.sslCAInfo "proxy.crt"

透過的Proxyが導入されている場合の自己証明書設定

git config --global http.sslCAInfo "proxy.crt"
git config --global https.proxy "myproxy:8080"

特定のURLだけ設定を変える

git config --global http.<URL>.proxy ""
git config --global http.<URL>.sslCAInfo ""

参考文献

Shoken Startup Blog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment