Can you still push from outside BitBucket Cloud when you enable branch permissions?

jonwupc
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2018

I enabled branch permissions so that people have to merge from a pull request to get code onto master. However, when we tried to merge and push from our Git client (so we can use different merge strategies and clean up the branch with interactive rebase), we got an error:

remote: permission denied to update branch master
To bitbucket.org:.../....git
! [remote rejected] master -> master (pre-receive hook declined)

A pull request was already open for this and we were able to merge online, but should it still work from outside Bitbucket as long as the PR was approved?

1 answer

1 vote
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 22, 2018

It won't work if the user attempting to push directly to master doesn't have permission to push directly to master. The contents of the push and the existence of a pull request aren't really relevant in that case.

Jon Wu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2018

Thanks for clarifying. I wasn't clear from the docs whether the PR had to be merged via web before.

I was hoping that the pre-commit hook could look up the existience of an open pull request that was being merged in, then allow the merge commit through if there was a PR in a similar way to how pull requests are automatically closed and updated when a corresponding merge is pushed. The bummer with this current limitation is we can only use the merge strategies that the web UI allows.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events