我正从我的Windows框推送到从http(而不是ssh)地址克隆的存储库。每推一次,我都要输入我的u / p。我想自动化这个过程。我尝试过以下方法:
$ git config credential.helper cache
$ git config credential.helper 'cache timeout=360000'
但这些设置没有任何效果,我仍然需要每次输入u / p。有没有办法让它自动化?
答案 0 :(得分:6)
使用_netrc文件存储远程机器的用户名/密码,描述为here
答案 1 :(得分:2)
较新版本的Git支持更精简的credentials API。根据凭证帮助程序的实现,这通常比使用.netrc。
更方便和安全流行的Windows凭据帮助程序是git-credential-winstore.exe。只需下载到git / bin路径并执行即可。 Github提供similar helper。
此处的其他详细信息(但不是Windows特有的):