前言
最近服务器重装了centos7, 使用git拉取代码和提交代码每次要输入邮箱和密码比较麻烦,所以就配置了默认邮箱和密码,配置也比较简单,就记录下步骤。
内容
1.配置下默认用户名邮箱
git config --global user.name "xxxxx" #用户名
git config --global user.email "xxxx@qq.com" #密码
2.修改上面的命令生成的git 配置文件.gitconfig
vi /root/.gitconfig
[credential]
helper = store
3.切换到项目根目录,执行下面命令
git config --global credential.helper store
最后
git命令执行pull或者push,输入账号密码,第一次需要,往后就不需要了