PaulStock
PaulStock

Reputation: 11263

How to setup GitHub repo so that certain team members can't write to master branch

Newbie GitHub question: I have setup an organization in GitHub and created a private repository. Now, how do I only allow only certain members the ability to push to the master branch, while allowing others the ability to create & push branches other than master?

Or am I thinking about this incorrectly? I basically want to have a review process so that code must be reviewed before being merged into master and don't want to let contributors just be able to push directly to master branch.

Upvotes: 0

Views: 270

Answers (1)

Simon Boudrias
Simon Boudrias

Reputation: 44609

The best will be to restrict writing to your main repo (where master live) to your allowed developper. And you give read access to the other; this way they can fork the repo (forks will remain private).

Then, when they want to merge with Master they send a pull request.

If unauthorized developpers need to share branches between them, they can then add each other forks as remote and pull/pull request as any other repo.

Hope this help!

Upvotes: 1

Related Questions