I have followed the instruction online. After creating the branch protection rules, I can find a place as the instruction to fill in the specific branch I want to apply to. I am using free private repo with school licensed account, not enterprise. Is that the reason? But I am confused cause I am allowed to create the rules.
The rules are apply on the branch specify on the box called “Branch name pattern” , here you put the name of the branch where you want to apply that rules.
For example you want to apply a set of rules to all the master versions, let me call them MyRules , to do that you need to fill the branch name pattern with something like masterV1.0:
With this all the branch that take that name are subject to that rule. But if you want to use MyRules to a pack of branches you need to use something like this:
This rules are apply to all of the branch that have that format, some examples: master-V1.8 or master-V7.2 , but are not apply to a branch called master or a branch called newFeature.
So you can’t apply that rules by choosing from a set of branch that you already created, but you need to follow the pattern you defined previously to apply that.
The name of that pattern is wildcards, here is the basic set of wildcards:
- * - represents zero or more characters
- ? - represents a single character
- [x-y] - represents a range of characters
Hope this help, ask for more if you need
Mark helpfull posts with Accept as Solution to help other users locate important info. Don’t forget to give Kudos for great contents!