且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

GitHub企业挂钩只允许某些用户提交?

更新时间:2023-11-30 15:39:28

注意:如果


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

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