git配置用户名密码,避免重复输入密码

1.配置用户名密码。分为设置全局和局部,我们直接设置全局的。

#设置局部的话,直接去掉  --global  选项即可
git config --global user.name  "你的username"  
git config --global user.email  "你的email"

如果换了账号密码,用--replace-all替换全部

git config --global user.name  "你的新的username"  
git config --global user.email  "你的新的email"

查看配置是否修改成功

# 用  --list
git config --list
# 或直接看配置文件
vi ~/.gitconfig

2.避免重复输入密码。上面做完之后,下次提交时还需要重复输入密码,用下面方法解决

git config --global credential.helper store
发布了7 篇原创文章 · 获赞 2 · 访问量 3887

猜你喜欢

转载自blog.csdn.net/weixin_40331125/article/details/104545172