尽管使用 SSH 真是相当方便,但总有些时候不得不使用 HTTP/HTTPS 之类的 git 后端——时常是由于网络环境限制导致。这时每次输入用户名密码真是相当烦心。从 1.7.9 版本开始, git 提供了 credential helper 来消除这一烦恼,且现在在各个平台下都有相当合用的 helper :

Platform independent

git 自带了两个平台无关的 helper : cache 和 store ,前者在内存中缓存凭据(可以设置有效时间),后者将凭据明文储存在硬盘上,除非文件系统有启用加密,否则不推荐使用。简单提一下前者的使用方式:

git config --global credential.helper cache
git config --global credential.helper "cache --timeout=3600"

以下平台相关的 helper 推荐使用 git 1.8.3 以上版本!

Read More