github是否允许预接收钩子? [英] Does github allow pre-receive hooks?

查看:221
本文介绍了github是否允许预接收钩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GitHub允许预接收或更新挂钩吗?

我想要做的是防止主要分支被推到(即master,hotfix,develop)并且要求它们通过GitHub pull合并请求。这是一个私人回购,所以GitHub风格分叉不是一种选择。



有关如何完成此操作的任何建议都会对您有所帮助。 解决方案

只有您列出协作者的人才能推送到Github托管的存储库。查看存储库的管理员页面以添加协作者。每个人都需要提交一个拉取请求,以便让存储库管理员接受其添加。请参阅 Github访问权限。 (没有每个分支的访问权限。)所以,为了实现你的目标,你不需要钩子;您需要的内容已经内置。



两个注释:


  1. private Github存储库可以有多个贡献者

  2. 如果钩子包含任意代码,那么Github支持预接收钩子(或任何其他服务器钩子)是不正常的。


Does GitHub allow for pre-receive or update hooks?

What I would be looking to do is to prevent the primary branches from being pushed to (i.e. master, hotfix, develop) and require that they be merged via a GitHub pull request. This is a private repo so GitHub style forking is not an option.

Any advice on how to accomplish this would be of great help.

解决方案

Only people that you have listed a 'collaborators' can push to a Github hosted repository. See the repository's 'admin' page to add collaborators. Everybody else needs to submit a 'pull request' to get their additions accepted by the repository's administrator. See Github Access Permissions. (There aren't per-branch access permissions.) So, in order to accomplish your goal, you don't need hooks; what you need is already built in.

Two Notes:

  1. private Github repositories can have multiple contributors
  2. it would be unusual for Github to support pre-receive hooks (or any other server hooks) given that hooks contains arbitrary code.

这篇关于github是否允许预接收钩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆