1

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

  1. What exactly is being checked? Is it username and email? Is anything else checked?
  2. 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.

kgf3JfUtW
  • 13,702
  • 10
  • 57
  • 80

1 Answers1

1

1. What exactly is being checked?

Username and email. These are user.name and user.email in your Git configuration.


2. Which username/email is BitBucket expecting?

Log into your BitBucket account. The expected values are listed under "Account settings".


enter image description here

kgf3JfUtW
  • 13,702
  • 10
  • 57
  • 80