前端analysis | 3w & 1h

《Git》- 只输入一次密码操作配置

2020-01-17

直接进入主题,每次提交代码,都需要输入一次username、password,有点繁琐。那如何配置一次即可呢?
本文假设前提,你已有git账户密码、配置好了key。

git安装

直接一步步next

查看git system配置

git config –systeml -l

1
2
 $ git config --system -l
credential.helper=manager
1
2
#重置manager
git config --system --unset credential.helper

git 账户、密码存储配置-.gitconfig

1
2
3
4
5
[user]
name = your username
email = your email
[credential]
helper = store

git 账户密码输入

1
$ git pull # 项目路径下,触发账户密码输入;配置完毕再次git pull 就 不用输入密码了

查看git配置完毕后

git config –global -l

1
2
3
4
$ git config --global -l
user.name=your username
user.email=<your email>
credential.helper=store

git config –local -l

1
2
3
4
5
6
7
8
9
10
11
$ git config --local -l
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.name=your username
user.email=<your email>
Tags: git
使用支付宝打赏
使用微信打赏

若你觉得我的文章对你有帮助,欢迎点击上方按钮对我打赏