Create one branch protection rule for multiple branches in Github

Viewed 5585

I have multiple branches like develop, master, sit, uat, testbed, preprod, etc.. in my Github repository.

I want to create one branch protection rule for multiple branches.(above mentioned branches)

I am aware that same branch protection rule can be created multiple times for each branch.But this is time consuming and not an efficient way.(Since all the branches need the same rule)

Please provide any suggestions or solutions.

1 Answers

Use [main;develop]* when you want to add rule for branches main and develop. Just write all the branches you want to add in the square brackets [] and separate them with semicolon ;. At the end add *

Related