一、问题现象
使用 git push
命令提交代码,提示用户/邮箱不正确。现象如下:
➤➤➤ git push
Counting objects: 47, done.
......
remote: Processing changes: refs: 1, done
remote: ERROR: commit a8c8cc6: email address xxxx is not registered in your account, and you lack 'forge committer' permission.
......
二、解决办法
1. 验证当前的用户名/邮箱
➤➤➤ git config user.name
xxxxxx
➤➤➤ git config user.email
xxxxxx
2. 如果需要修改,方式如下
➤➤➤ git config --global user.name "zzzz"
➤➤➤ git config --global user.email "zzzz"
➤➤➤ git commit --amend --reset-author
3. 重新提交
➤➤➤ git push