Restricting rights on GitHub

My team is currently using Gerrit as code review tool for our git repos. Now we want to move some of them to GitHub. I’m not expecting to have as fine grained control over the rights as would be the case with Gerrit.

I would however like to restrict direct pushing onto master. People should first create a pull request and then have this merged by a colleague. These same people should be able to merge pull requests, so not giving them any rights on the repo is not an option.

Is this possible somehow?

  • Add commits to a merged branch and start a new pull request
  • Can I make a pull request after a git clone?
  • git commit and push to branch but not to pull request
  • Create/Update a Git pull request from command line?
  • Merge in GitHub pull requests, possibly making changes to them first
  • Push changes from fork as multiple pull requests
  • Atlassian Stash says that the second pull request merged remotely
  • Push to GitHub fork takes no effect, says all commits up to date, but made some changes
  • One Solution collect form web for “Restricting rights on GitHub”

    Github doesn’t have fine-grain permission settings, or at least not fine enough to disallow push but allow merging pull-request. Pre-receive hooks would also allow to distinguish pushes and pull-requests, but they can’t be used on GitHub. So you have two options:

    • forbid people from directly pushing to GitHub, even if technically they can
    • use GitLab along with Gitolite, which will allow much more powerful permissions, and provide the same kind of functionalities than GitHub
    Git Baby is a git and github fan, let's start git clone.