I've read about protecting branches within GitHub and it seems the system has policies in place for this. What I want to achieve is for only certain individuals to post to particular branches. From what I've read here, it seems this can be achieved through using the option Restrict who can push to matching branches.
I am not the owner of the repository, which means I can not view the settings for this repository, so I will be relaying this information to them. Therefore, in order to test this setting out, I looked at my own personal repository and I don't see this option available. Both my repository and the one I'm working with are non-business accounts. Does this effect me not being able to see the option? In addition, I don't have any collaborators against my personal repository to test this setting. Do I have to have at least one other person having access to the repository in order to view this setting?
Here is an attachment picture of what options are availble for adding a branch rule to my repository:
Solved! Solved! Go to Solution.
Yes, there are two separate features at work here: protected branches and branch restrictions. Branch restrictions is the feature that allows organization owners and people with admin permissions for organization-owned repositories to enforce branch restrictions so that only certain users or teams are able to push to a protected branch. See the links above for more information.
I hope that helps!
I have the same problem.
I have admin account of a Pro Github account but the options of "Restrict who can push to matching branches" doesn't appear on my page as well.
Below is the screenshot.
Could anyone help me with this matter?
Thanks in advance.
Does the repository you're attempting to modify belong to an organization? Or is it a repository in your personal account? As I stated above:
> Branch restrictions is the feature that allows organization owners and people with admin permissions for organization-owned repositories to enforce branch restrictions so that only certain users or teams are able to push to a protected branch.
If you're not working with a repository that belongs to an organization, branch restrictions will not be available.
I hope that helps!