Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Does setting branch permissions for two branches prevent pushing new branches?

Hello, I've set up branch permissions for two branches, master and example, as follows:

Branch     Access Type                      Users and Groups

Master      Write Access                     Administrators

                  Merge via pull request

Example    Write Access                     Administrators

                   Merge via pull request

 

I am in the Administrators group and another developer is in a group called "Developers".  Both he and I are having trouble pushing branches up to the repository.  For example, when I try to push a local branch up to the repo like this:

> git push origin MyNewLocalBranch

I get the following output:
Counting objects: 4, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 4.95 KiB | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: hooks/pre-receive: line 5: /opt/python/domains/bitbucket.org/current/bitbucket/scripts/git/hooks/pre-receive: No such file or directory
To git@someorg.bitbucket.org:someorg/practicework.git
! [remote rejected] MyNewLocalBranch -> MyNewLocalBranch (pre-receive hook declined)
error: failed to push some refs to 'git@someorg.bitbucket.org:someorg/practicework.git'

 

I suspect that this has something to do with the branch permissions because I just set up the branch permissions to protect the two branches above and, prior to setting up branch permissions, we were both able to push local branches to the repository without any trouble.  I have been over the documentation a couple of times and it doesn't mention that setting up branch permissions would exclude other new branches from being pushed.  The documentation doesn't describe this exact situation but it seems to be saying that the branch permissions just affect the listed branches.

 

I don't know if this is relevant or not but, if I go to the website and manually create the branch and then push into it from git, that works with the following output from git:
Counting objects: 4, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 4.95 KiB | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote:
remote: Create pull request for MyNewLocalBranch:
remote: https://bitbucket.org/someorg/practicework/pull-requests/new?source=MyNewLocalBranch&t=1
remote:
To git@someorg.bitbucket.org:someorg/practicework.git
b2cf75e..ebc796b MyNewLocalBranch -> MyNewLocalBranch

That's fine as a workaround but I would love to be able to get back to being able to push arbitrary local branches in git up to the repository without having to go into the website to create them first every time.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,849 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you