git自动保存账号密码(可分项目)

命令方式:

1、执行保存账号命令

# 保存本地仓库的账号
git config --local credential.helper store

# 保存git全局账号
git config --global credential.helper store

之后git执行pull、push等操作时输入账号密码后会自动保存。

编辑git配置文件方式:

文件位置:项目根目录下 .git/config

linux:

进入git项目根目录

vi .git/config

文件末尾添加内容:

[credential]

helper = store

 

之后git执行pull、push等操作时输入账号密码后会自动保存。

posted @ 2021-12-22 15:11  lazyang  阅读(594)  评论(0)    收藏  举报