简体   繁体   中英

BitBucket/Git error: You can only push your own commits in this repository

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.

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".


在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM