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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章