【问题标题】:BitBucket/Git error: You can only push your own commits in this repositoryBitBucket/Git 错误:您只能在此存储库中推送您自己的提交
【发布时间】:2020-07-06 12:40:34
【问题描述】:

问题

我无法推送到 BitBucket 存储库的远程分支,出现以下错误。

remote: You can only push your own commits in this repository
remote: Commit 0123456789abcdef was committed by my_username<my_email@company.com>
To ssh://git@bitbucket:7999/my_project/my_repo.git
! [remote rejected] my_branch -> my_branch (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@bitbucket:7999/my_project/my_repo.git'

观察

  • 这可能是 BitBucket Verify Commit hook 造成的
  • 我了解上述钩子检查执行推送的用户必须等于新提交的作者
  • 我确保git config 拥有正确的电子邮件和用户名

问题

  1. 具体检查的是什么?是用户名和邮箱吗?还有什么检查吗?
  2. 我如何知道 BitBucket 期望的确切用户名和电子邮件组合?

Error in git: You can only push your own commits in this repository 提出了同样的问题,其中一种解决方案是禁用验证提交挂钩。但是,这只是一种解决方法,我确实打算让钩子继续运行。

【问题讨论】:

    标签: git bitbucket


    【解决方案1】:

    1。究竟要检查什么?

    用户名和电子邮件。这些是您的 Git 配置中的 user.nameuser.email


    2。 BitBucket 需要哪个用户名/电子邮件?

    登录您的 BitBucket 帐户。预期值列在“帐户设置”下。


    【讨论】:

      猜你喜欢
      • 2019-03-23
      • 2013-03-02
      • 2021-06-03
      • 2013-04-11
      • 2011-08-11
      • 2015-02-12
      • 2012-06-01
      • 2016-10-29
      相关资源
      最近更新 更多