命令方式:
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等操作时输入账号密码后会自动保存。