I want to start a new public repository but restrict who actually can push to certain branches like master or develop.
According to GitHub's help page about protected branches, Branch protection rules have an option called "Restrict who can push to matching branches".
Looking at my repository I cannot find this option. Is it limited to some paid plans? And if so: How do open source projects protect their GitHub repositories?
Your question seems to be based on a misunderstanding of what "public" means in this context. Public repositories are publicly readable but not writable.
Anyone can clone the repository, but only collaborators that you invite can write to it. You don't need to do anything to stop people committing to master or develop.
If someone you haven't invited to become a collaborator wants to submit something to your repository then they can:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With