git のパスワードをキャッシュする

仕事先の環境からは ssh が通らないため、自宅 gitサーバ(forgejo) には https 接続している。

https/http 接続ではそのままだといちいちユーザーID、パスワードを聞いてきてなかなかしんどい。
なので、キャッシュ設定をする。

環境は linux です、mac や Windows は参考リンクに載ってます。

$ git  config credential.credntialStore plaintext

$ cat ~/.git-credentials
https://xxxxxxxx@xxxxxxx

参考

git パスワードを毎回聞かれる問題をHTTPSでも解決 #Git – Qiita
ここの git config credential.helper store も実行する必要があるかもしれない。

Caching your GitHub credentials in Git – GitHub Docs

git-credential-manager/docs/credstores.md at release · git-ecosystem/git-credential-manager