Problem
I'm cannot push to a remote branch of a BitBucket repository, getting below error.
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'
Observations
- It's probably the BitBucket Verify Commit hook causing this
- I understand the above hook checks that the user doing the push must equal to the author of the new commits
- I ensured that
git config
has the correct email and username
Questions
- What exactly is being checked? Is it username and email? Is anything else checked?
- How do I know which exact username and email combination BitBucket is expecting?
Error in git: You can only push your own commits in this repository asked the same question, where one solution was to disable the Verify Commit hook. However, that's just a workaround, and I do intend to have the hook continue running.