GIT 错误:- 预期的提交者电子邮件 '' 但找到了 '[email protected]'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28425670/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
GIT Error:- expected committer email '' but found '[email protected]'
提问by Karan Singla
Git push is getting rejected with the following error message:
Git push 被拒绝并显示以下错误消息:
expected committer email '' but found '[email protected]'
I have already tried:
我已经尝试过:
- setting use properties in .gitconfig file.
- trying git push making different clones of same repository.
- setting up whole system all together after formatting it.
- 在 .gitconfig 文件中设置使用属性。
- 尝试 git push 制作同一存储库的不同克隆。
- 格式化后将整个系统设置在一起。
But none has worked. What else can I do to resolve it.
但没有一个奏效。我还能做些什么来解决它。
采纳答案by VonC
This doesn't seem like a git limitation, but should be some kind of pre-receive hook on the remote side (the Git repository hosting service/server to which you are pushing to)
这似乎不是 git 限制,但应该是远程端的某种预接收钩子(您推送到的 Git 存储库托管服务/服务器)
That hook seems to parse the commits and check the committer email against a specific criteria which rejects [email protected]
.
You should check with the remote side administrator to see what is going on.
该钩子似乎解析提交并根据拒绝的特定标准检查提交者电子邮件[email protected]
。
您应该与远程端管理员联系以了解发生了什么。
The OP Karan Singlaconfirms in the commentsit was an issue at the server side:
该OP卡兰Singla证实在评论它是在服务器端的问题:
Issue got resolved. Admin re-created my account and it is working fine now.
问题得到解决。管理员重新创建了我的帐户,现在工作正常。
回答by Atul Soman
This worked for me
这对我有用
git config --global user.name "Correct Name"
git config --global user.email [email protected]
git commit --amend --reset-author
回答by Jaydeep Shil
This work for me :
git config --global user.name "Correct Name"
git config --global user.email [email protected]
git commit --amend --reset-author
it will show the screen where you can edit the commit message, after edit or keep it as it is, then press escape and then :wq and hit enter
git push
回答by Akin Okegbile
回答by t0r0X
Had a similar situation where a hook was involved, as @VonC mentioned, while trying to do the initial push (which contained commits from me and other colleagues) to a empty Bitbucket Git repo (self-hosted in-house Bitbucket instance). In my case it was the YACC (Yet Another Commit Checker) hook which complained, see also this Atlassian article.
正如@VonC 提到的,在尝试对空的 Bitbucket Git 存储库(自托管的内部 Bitbucket 实例)进行初始推送(其中包含我和其他同事的提交)时,遇到了类似的情况,其中涉及到一个钩子。在我的情况下,是 YACC(又一个提交检查器)钩子抱怨,另见这篇Atlassian 文章。
But, instead of globally deactivating the hook (as suggested by the Atlassian article), I explicitly activated it for my repo with emptysettings (that overrides the global hook settings for my repo), made the initial push, then again disabled the plugin in my repo (which leaves the plugin still active, but configured with the global server settings!).
但是,我没有全局停用钩子(如 Atlassian 文章所建议的那样),而是使用空设置(覆盖我的回购的全局钩子设置)为我的回购明确激活它,进行初始推送,然后再次禁用插件我的回购(这使插件仍然处于活动状态,但配置了全局服务器设置!)。
回答by David V
I would suggest to open git terminal and set correct email. This worked for me when I encountered same issue.
我建议打开 git 终端并设置正确的电子邮件。当我遇到同样的问题时,这对我有用。
git config --global user.email "[email protected]"