【git报错】 push git remote: ERROR: committer email address remote
使用git推送到分支的时候,会有这样报错:gerri push git remote: ERROR: committer email address remote: ERROR: does not match your user accoun
·
使用git推送到分支的时候,会有这样报错:
gerri push git remote: ERROR: committer email address remote: ERROR: does not match your user accoun
原因是:
本地配置的用户名邮箱配置错误。(可能是之前拉取过别的仓库的代码)
修改配置方法:
配置用户名
$ git config --global user.name "loushengyue"
查看已配置的用户名
$ git config --global user.name
配置邮箱
$ git config --global user.email loushengyue@xx.com
查看已配置的邮箱
$ git config --global user.email
切记!!此时你已经commit到本地,所以你修改完再推送还是按照之前的配置来,还会报错,所以此时你需要将之前的commit进行reset一下
使用命令:
git reset --soft HEAD^
HEAD^的意思是上一个版本
如果你进行了2次commit,想都撤回,可以使用HEAD~2
此时再重新commit,重新push,大功告成!
更多推荐
已为社区贡献2条内容
所有评论(0)