You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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:
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.
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/*