LoginSignup
30
25

More than 5 years have passed since last update.

windowsのgit-credentialでユーザ名パスワード入力を簡略化する

Posted at

何度もパスワードを求められてうるさいので簡略化する

何も考えないというのであれば以下のような形で良いのだが

git config credential.helper store

これだと平文で保存されてしまう。(~./gitcredential というファイルにパスワードもそのまま保存されている)

セキュリティ的に安心したいのでもう少し違うパターンを試す。
どうやらwindowsには他のcredential.helperがあるらしい。
しかし、windowsの場合はexeを落としてこないと行けないらしい
http://gitcredentialstore.codeplex.com/releases/view/106064

ダウンロードしてきた後、exeを叩く。
cygwinを起動して、認識されているかを見る

git help -a | grep credential-

  credential-cache          remote-ftp
  credential-cache--daemon  remote-ftps
  credential-store          remote-http
  credential-winstore

こんな感じで出てきたら次に.gitconfigに以下を追加する

[credential]↲
  helper = winstore↲

設定は以上。
本当に聞かれないか確かめる。

$ git pull

credential.png
まずは、最初にこんな感じのダイアログがでてきたので入力する。

Already up-to-date.

認証できたようです。
もう一度やってみると、ダイアログが出てこない。

$ git pull
Already up-to-date.

再度聞かれなかったので、どうやら、できたようです。

補足

実際じゃあどこにパスワードとか保存されてるんだということですが 、git を https 経由で使うときのパスワードを保存するによると

Internet Explorer などと同じ場所にパスワードが保存され、以後はパスワード入力が不要になります。

ということです。

参考

https://ja.confluence.atlassian.com/bitbucketserver/permanently-authenticating-with-git-repositories-776639846.html
http://qiita.com/usamik26/items/c655abcaeee02ea59695

30
25
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
30
25