GIT Error:- expected committer email '' but found 'karan@xyz.com'

后端 未结 6 2049
旧巷少年郎
旧巷少年郎 2020-12-29 07:48

Git push is getting rejected with the following error message:

expected committer email \'\' but found \'karan@xyz.com\'

I have already tri

相关标签:
6条回答
  • 2020-12-29 07:53

    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.

    But, instead of globally deactivating the hook (as suggested by the Atlassian article), I explicitly activated it for my repo with empty settings (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!).

    0 讨论(0)
  • 2020-12-29 07:55

    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)

    That hook seems to parse the commits and check the committer email against a specific criteria which rejects karan@xyz.com.
    You should check with the remote side administrator to see what is going on.


    The OP Karan Singla confirms in the comments it was an issue at the server side:

    Issue got resolved. Admin re-created my account and it is working fine now.

    0 讨论(0)
  • 2020-12-29 08:00

    I would suggest to open git terminal and set correct email. This worked for me when I encountered same issue.

    git config --global user.email "your_correct_email@example.com"
    
    0 讨论(0)
  • 2020-12-29 08:02
    This work for me :
    git config --global user.name "Correct Name" 
    git config --global user.email name@email.com 
    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
    
    0 讨论(0)
  • 2020-12-29 08:06
    git config --list --show-origin
    

    Allows you to see the file where the setting is coming from. In my case it was an unrelated git settings file somehow making it into my portable git install.

    0 讨论(0)
  • 2020-12-29 08:08

    This worked for me

    git config --global user.name "Correct Name" 
    git config --global user.email name@email.com 
    git commit --amend --reset-author
    
    0 讨论(0)
提交回复
热议问题