Does github allow pre-receive hooks?
git, github
Solution
Only people that you have listed a 'collaborators' can push to a Github hosted repository. See the repository's 'admin' page to add collaborators. Everybody else needs to submit a 'pull request' to get their additions accepted by the repository's administrator. See Github Access Permissions. (There aren't per-branch access permissions.) So, in order to accomplish your goal, you don't need hooks; what you need is already built in.
Two Notes:
- private Github repositories can have multiple contributors
- it would be unusual for Github to support pre-receive hooks (or any other server hooks) given that hooks contains arbitrary code.
Problem
Does GitHub allow for pre-receive or update hooks? What I would be looking to do is to prevent the primary branches from being pushed to (i.e. master, hotfix, develop) and require that they be merged via a GitHub pull request. This is a private repo so GitHub style forking is not an option. Any advice on how to accomplish this would be of great help.