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
Hi @Vsevolod Romanchenko and welcome to the community!
If you are an admin of a Bitbucket Cloud repo, you can do the following:
If you set Write access to Only specific people or groups have write access and then leave the field below it empty, no one will be able to push to the branch or branches with this restriction.
In the Select branches option, you need to specify the branch name or pattern for which the restriction will apply.
You can see more details on branch restrictions here:
Please feel free to let me know if you have any questions.
Our development team has been working on a feature that will allow admins to set branch permissions on a project (and then these will apply to all repos of a certain project). When this is implemented, we are going to update the public feature request we have in our issue tracker:
You can also add yourself as a watcher to that feature request (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.
In the meantime, until this feature is implemented, another option would be to write a script that uses our APIs in order to set the branch restrictions.
The following API endpoint gets all repos in a workspace:
This API endpoint creates a branch restriction for a repository: