git tortoiseGit 记住账号密码

参考文章1  https://www.cnblogs.com/lykxbg/p/13655928.html

参考文章2  https://www.cnblogs.com/sapho/p/6140331.html

参考文章3  https://www.softwhy.com/article-8486-1.html

TortoiseGit在提交或者pull时总会提示你输入用户名密码,非常麻烦,那如何解决呢?

1. 对于TortoiseGit 1.8.1.2及其后的版本,右键选择settings ——> Git ——> Credential,
里面有wincred-this repository only,wincred-current Windowsuser这些选项,按自己的需求,选中一个确定即可。

2. 还有一种方法是在C:\User\Administrator里面的.gitconfig文件里,让[credential]的helper = store,设置完后,输入一次密码就不会再要求输入,但是会生成一个.git-credentials文件,里面记录了你的用户名和密码,所以这种方法慎用。

我使用了方法2的时候,发现没有找到该文件.gitconfig

于是乎,需要通过命令行设置

git config -e --global

得到如图(该图是我已经设置好的,如果没设置好,helper = wincred)

编辑后,设置成helper = store 如上图,然后点击ESC退出键,接着 

:qw

保存退出,就可以保存账号密码了

猜你喜欢

转载自blog.csdn.net/weixin_40918145/article/details/112025890