中间件-git-centos7解决git每次都要输入账号密码的问题

1、配置用户名邮箱

1
2
git config --global user.name "用户名"
git config --global user.email "邮箱"

2、查找.gitconfig文件位置

1
find / -name .gitconfig

3、打开.gitconfig文件
4、加入下面的代码

1
2
[credential]
        helper = store

5、切换到项目根目录,执行下面命令

1
git config --global credential.helper store

6、按平常git命令执行pull或者push,输入账号密码,第一次需要,往后就不需要了

posted @ 2021-01-22 11:22  赤子说  阅读(258)  评论(0编辑  收藏  举报