提交者电子邮件地址在IntelliJ中不匹配,甚至将其更改为正确的

Tad*_*nas 23 git intellij-idea gerrit

当我尝试将我的提交从git存储库推送到IntelliJ想法中的Linux环境中的gerrit远程存储库时,我收到以下错误:

remote: ERROR:  committer email address ***** [K
remote: ERROR:  does not match your user account.[K
Run Code Online (Sandbox Code Playgroud)

即使我将设置更改为git和gerrit的正确设置(我可以在git config -l控制台上看到它),它仍然会选择旧的"错误"电子邮件.

可能有什么不对?

Fré*_*nri 60

你需要重新配置你的电子邮件

$ git config user.email <your email>
$ git commit --amend --reset-author
Run Code Online (Sandbox Code Playgroud)

git commit --amend 更新您的上次提交

  • 如果你有较旧的提交没有合适的作者,你需要更新那些,运行`git log`来检查哪些提交没有正确的作者然后运行`git rebase -i <commit你要修改> ^ `所以你可以再做一次`git commit --amend --author"New Author Name <email@address.com>"`(或--reset-author)并继续变基.一旦你修复了所有提交,你应该能够推动 (4认同)