Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Project Branch restrictions block branch creation

Sascha Metz June 5, 2025

Hello,
we configured branch restrictions on a project level for the master branch. So all repositories accept changes only by Merge via pull requests from branches different to the master. 

grafik.png

 

Then we created a new repository containing one master branch. 
And now it seems that BitBucket wants us to create a readme or .gitignore file before we can create new branches in the new repository.

But the project settings do not allow a direct commit to the master branch.

So I had to deactivate the restrictions for the whole project. Then we added a .gitinore and committed it to the master. After that we were able to create a new branch and the branch restrictions wer reactivated.

How can we keep the branch restrictions on the project level and work with new repositories?
How can we get this first file needed in a repository if merges to the master without QA measures are forbidden?

1 answer

1 vote
Aron Gombas _Midori_
Community Champion
June 6, 2025

How can we keep the branch restrictions on the project level and work with new repositories?

As far as I know, it is not possible. (There are other settings that can be set on the project level, like custom merge checks, but even that is possible only in the Premium plan.)

How can we get this first file needed in a repository if merges to the master without QA measures are forbidden?

Have you tried the "add file" from the web UI? (I don't know how that works in the background, but it is definitely worth a 10 second long try.)

midori-global-carchc-—-Bitbucket-06-06-2025_09_17_AM.png

Sascha Metz June 10, 2025

Hello Aron,

thank you for your fast reaction.

It seems that your screen is only available after the first file was added to the new repository.
If you create a new repository without these files

grafik.png

then you enter the repository after creation and find this

grafik.png

But adding a file is forbidden without a pull request.
And since there is no option to create a branch I don't see a way to create a PR.

Currently the only workaround is the temporal deactivation of the restrictions.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events