Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Enterprise Hook to only allow certain users to commit?

Does anyone know of a hook for GitHub Enterprise which will allow me to only have certain accounts on a repository commit to certain branches? Sorry if this is a basic question just kicking off this GitHub stuff.

What I am setting up is a public project - All engineers can push and pull Master Branch is controlled by Dev Lead and is only the shipping code. Development branch is where all dev happens.

I want to make sure that and engineer not authorized does not commit to master. and if they try it will be kicked back

like image 316
iOSGuy Avatar asked Apr 19 '26 07:04

iOSGuy


1 Answers

Note: if the GitHub pull-request workflow isn't your cup of tee, BitBucket offers protected branches which can be closer to what you were looking for initially.

The branch management includes "limit push" powers:

You can set rules that limit who can push to a branch. Rules specify the groups and/or users that can push to a branch. Any user that doesn't meet the rule can't push to a repository. You can only create rules for users and groups that have write permissions or higher.

This kind of feature isn't available yet on GitHub.


Update September 2015:

That feature is now close to be available, with "Protected branches and required status checks" (September 3, 2015)

It will allow you to protect a branch:

  • against forced pushed
  • against deletion
  • against merged changes until required status checks pass

https://cloud.githubusercontent.com/assets/25792/9596474/27db3ce6-502a-11e5-9b19-5b47a8addc65.png

like image 103
VonC Avatar answered Apr 21 '26 01:04

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!