第一种方法
1、打开Git 配置文件,该文件中保存着所有的配置信息
vim ~/.gitconfig
2、修改配置文件,添加下面这一行。
// 记住密码:
[credential]
helper = store #用来保存密码,提交一次会自动记住
// 密码保存一个小时:
[credential]
helper = cache -- timeout 3600 # 密码只保存一个小时
第二种方法
git config --global credential.helper store