【发布时间】: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拥有正确的电子邮件和用户名
问题
- 具体检查的是什么?是用户名和邮箱吗?还有什么检查吗?
- 我如何知道 BitBucket 期望的确切用户名和电子邮件组合?
Error in git: You can only push your own commits in this repository 提出了同样的问题,其中一种解决方案是禁用验证提交挂钩。但是,这只是一种解决方法,我确实打算让钩子继续运行。
【问题讨论】: