GitHub: Restrict Access to specific branch [duplicate]
Asked Answered
Q

1

3

Is there a way to restrict access to certain branches within a repository? We have production and master branches which sometimes get messed up with rogue pushes.

Quinquagesima answered 17/9, 2013 at 18:20 Comment(0)
D
8

Not with GitHub in the same repo.
(as opposed to local repos, which can be protected by an authorization layer like gitolite)

You could have:

  • one repo for production and master branch, with only the prod team as collaborators (if there need to be contribution by others, they can fork that repo)
  • one repo for other (more "public") branches, for the rest of the team.

Update: I still prefer having two repos, but you now (Sept. 2015) can protect a branch on GitHub.
See "How to protect “master” in github?".

Darill answered 18/9, 2013 at 6:40 Comment(3)
Elegant and easy. Thanks Vonc!Quinquagesima
@Darill any pointer on how a neat setup ensures pull requests and code reviews across the public and production repos?Scurrility
@Scurrility mainly putting a gerrit between the two: https://mcmap.net/q/276867/-send-commits-for-reviewDarill

© 2022 - 2024 — McMap. All rights reserved.