GitHub Enterprise Hook to only allow certain users to commit?

余生长醉 提交于 2019-12-05 18:29:31
VonC

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

Instead of giving your employees push access to specific branches, just give them read-only access.

Each contributor can then fork the main repository, push commits to their own repo, And ask the dev lead to merge pull requests.

That way, the dev lead must approve all code integrations, and nobody will accidentally make commits on or edit the history of master.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!