服务器上每次执行git pull,都提示输入用户名和密码

1.执行命令:

git config --global credential.helper store

这个时候~/.gitconfig文件中会多一行

[credential]
helper = store

2.再次执行git pull 输入账号密码

此时你会看到/root/.git-credentials中会多一行内容。里面的内容类似https://{username}:{password}@github.com这种形式

或者是

[credential]
helper = store
[user]
email = XXXXX@qq.com
name =  yourname

形式

 

3.以后git pull 就不用输入密码了

posted @ 2020-05-18 07:54  winyh  阅读(1695)  评论(0编辑  收藏  举报