【问题标题】:Git push rejected due to expected committer email由于预期的提交者电子邮件,Git 推送被拒绝
【发布时间】:2018-05-05 22:27:29
【问题描述】:

尝试将带有错误修复的本地分支推送到原点并收到如下消息:

remote: Push rejected.
remote: refs/head/bugfix/issueX: hash1hash2hash: expected committer email 'a@email.com' but found 'z@email.com'
remote: refs/head/bugfix/issueX: hash1hash2hash: expected committer name 'A' but found 'Z'

计算机是“共享”测试/开发设备,“A”是之前的用户。我用

更改了电子邮件和姓名
git config --global user.name "Z"
git config --global user.email "z@email.com"

远程服务器正在运行 Atlassian Stash。 已经试过Expected Committer Name Git Push Issue

【问题讨论】:

  • 你能改变服务器上repo的设置吗?它可能有一个您不需要的电子邮件检查钩子(与链接的问题不同)。
  • 感谢您的快速答复。服务器上的 repo 有一个提交检查器,它检查提交者的电子邮件和名称是否等于 Stash 服务器用户的名称和电子邮件。我已经检查了我的用户名和电子邮件,一切正常。

标签: git git-push


【解决方案1】:

问题解决了。 .git-credentials 不包含用户 Z,而是包含用户 A 和一些较旧的用户。由于某些原因,它没有要求 Z 的凭据。我删除了现有文件并再次推送到源,然后 git 要求提供凭据。

【讨论】:

  • 小提示:如果您在共享计算机上工作,我不会使用git config --global。我会通过 git config user.name = "Z"git config user.email "z@email.com" 为当前存储库设置 git config。
猜你喜欢
  • 2018-05-27
  • 2017-07-28
  • 2017-09-08
  • 1970-01-01
  • 2015-04-10
  • 2016-01-05
  • 1970-01-01
  • 2021-11-14
  • 2014-06-04
相关资源
最近更新 更多