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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,156
Community Members
 
Community Events
176
Community Groups

How can I manage permissions in "children" branches?

gcover I'm New Here Jan 06, 2023

We have a branch structure for releases that is locked down permissions wise - `release/*` has very few write access, and only PR merge permissions.

I now want to create a structure where folks can create branches with the following name `release/*/child/*`. Having configured the permissions, and I understand there's overlap here with the first schema, we're seeing an error about not being able to create a branch while the "parent" exists.

Is this an odd wording of a permission related error (the overlap)? If I"m not able to achieve this, what are my other options given these ideals:

  • Folks can create branches "from" the release branch
  • Some folks can commit/push directly to that branch
  • Other folks can only merge via PR
  • When browsing branches it's easy/obvious what release a child branch comes from

That last point is the idea behind putting the branch names after the release...but if that's not going to work, I'm a bit short of ideas atm.

Thanks

 

1 answer

1 accepted

0 votes
Answer accepted

Hi @gcover and welcome to the community.

If there is a branch restriction for release/* and only certain users have write access, then only these users will be able to create a branch starting with release/. This was by design, and we have a feature request to change this here:

I would suggest adding your vote (by selecting the Vote for this issue link) and a comment to it to express your interest.

If branch permissions overlap, the results are determined by the table on the following documentation page:

Please keep in mind the following though:

If you already have a branch named release/123, it will not be possible to create a branch named e.g. release/123/child/456. This is a limitation of Git (and not Bitbucket) and it doesn't have anything to do with branch permissions.

Branches with the pattern A/B exist as a file named B in a folder named A. If you already have another branch named A, it will not be possible for Git to create a folder named A in order to save the branch A/B.

If you have locally a branch named release/123, then trying to create a branch release/123/child/456 is going to show the following error:

$ git checkout -b release/123/child/456
fatal: cannot lock ref 'refs/heads/release/123/child/456': 'refs/heads/release/123' exists; cannot create 'refs/heads/release/123/child/456'

You could work around this issue by creating a branch named release/123-child/456, so using the pattern release/*-child/* instead of release/*/child/*

Kind regards,
Theodora

gcover I'm New Here Jan 10, 2023

Thank you for the information, both on the Bitbucket side, and reminding me about the structure of git branches. I can work with this structure now to create something that works for us.

Like Theodora Boudale likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events