LoginSignup
15
11

More than 3 years have passed since last update.

Gitで毎回パスワードを聞かれないようにする

Last updated at Posted at 2019-05-20

問題

GitHubのリモートをhttpsにしていると、git pushなどの実行時に

Username for 'https://github.com': 
Password for 'https://github.com': 

といった形で毎回認証情報の入力を求められてしまいます。

解決方法

永続的に認証情報を保存

git config --global credential.helper store

を実行すると、入力した認証情報が永続的に保存されるようになります。
ただしパスワードが平文で保存されます。

一時的に認証情報を保存

git config --global credential.helper cache

を実行すると、入力した認証情報が一時的に保存されます。

デフォルトでは 900 秒(15分)で情報が破棄されます。
オプションを使うことでタイムアウト時間を指定できます。

git config --global credential.helper 'cache --timeout=3600'
15
11
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
15
11