Unable to protect any branches

Several days ago, I removed protection from my forked repository’s master branch. I’m unable to restore that protection. I selected Settings > Branches. After that, I do NOT see a Protected Branches option. Shouldn’t there be one? How can I restore protection to my master branch? My repository is public–https://github.com/johnsdean/spring5webapp/settings/branches

thanks,
john

There should be a “Branch protection rules” section on that page, with a small “Add rule” button on the side, as described in the Configuring protected branches documentation. For me it looks like that (both on forks and non-fork repos), if it’s not there for you that sounds like a case for Github support to me.

1 Like

Airtower (may I call you Airtower or do you prefer Mr. Airtower-Tuna?),

Thanks for the reply. I had seen the Branch protection rules section, but didn’t know what to enter for the rule. This time, I entered “master” in the “branch name pattern” box on the Branch protection rules edit page, but I doubt that my guess to enter “master” is correct. Do you know what I should enter for the rule or if I’m supposed to do something else?

thanks,
John-Seabass

If you want to use a honorific (not really necessary) it’s Ms. And Luna, not Tuna! :sweat_smile:

Anyway, “master” is correct if you want to protect only that branch. It’s called a pattern because you can use wildcards, e.g. if you enter ma* the rules would apply to branches called master, main, or marmalade alike. :wink:

1 Like

Dear Ms. Airtower-Luna,

Excellent explanation. Thanks!

unhonorifically yours,

john

1 Like