Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

523 views 4 13
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