每次更新git都要输入帐号密码比较麻烦,可以通过手动设置配置文件。

window下:

进入home文件夹,一般是C:\Users\Administrator,创建.git-credentials文件(可以先创建一个git-credentials文件,然后在git bash下使用命令 mv git-credentials .git-credentials),打开文件,输入  http://{用户名}:{密码}@{服务器域名或ip} 保存


在bash下,执行 git config --global credential.helper store


可以看到生成了.git-config文件,里面内容为

[credential]

    helper = store


同样,在linux下,在个人根目录下执行同样的操作即可。