本文介绍了我如何添加一个自定义的Git钩子到GitHub Enterprise仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我启动了一个GitHub Enterprise实例(11.10.272)并创建了一个存储库。我已经在Ruby中编写了一个预接收钩子,我希望将它用于该存储库。



GitHub Enterprise与常规GitHub一样允许配置服务钩子。我试图SSH到GitHub企业服务器来创建一个钩子文件,但我找不到repo目录。此外,GitHub Enterprise的条款禁止修改虚拟机,所以我不确定这是一个好方法。

看起来GitHub:FI支持钩子。 FI到企业迁移工具的当前版本当前不支持根据。

解决方案

根据我的电子邮件和GitHub客户支持,预接收挂钩不支持GitHub Enterprise截至2013年5月。



我们没有管理员访问我们的GHE箱,所以如果我们想要,我们不能进入并修复 。

他们声称如果你拒绝提交,他们所做的事情就会中断。我假设他们的意思是自动合并pull请求,但我不确定。



它们有一组广泛的post-commit webhooks,可以用于post -commit功能。



我正在研究构建一个传递git服务器 - 基本上,经常轮询GHE API以制作任何回购的本地克隆存在于特定的GHE帐户上,然后使用自定义预接收和接收后挂接进行自动克隆。这可以让我们克隆传递服务器,在那里做我们预先接收的钩子,并将批准的更改推送到GHE。目前似乎还没有任何一种标准的传递服务器可用于git,可能是因为您需要知道克隆的内容,它似乎没有标准的git API。


I've fired up an instance of GitHub Enterprise (11.10.272) and created a repository. I've written a pre-receive hook in Ruby which I'd like to use with that repository.

GitHub Enterprise, like regular GitHub, allows the configuration of service hooks. I tried to SSH into the GitHub Enterprise server to create a hook file, but I couldn't find the repo directory. Furthemore, GitHub Enterprise's terms forbid modifying the VM, so I'm not confident this is a great approach.

It seems GitHub:FI supported hooks. The current version of the FI to Enterprise migration tool does not currently support hooks according to Migrating from GitHub:FI.

解决方案

Based on my email with GitHub customer support, pre-receive hooks aren't supported for GitHub Enterprise as of May 2013.

We don't have admin access on our GHE box, so we couldn't go in and "fix" this if we wanted to.

They claim that things they do would break if you could reject commits. I assume they mean things like automatic merging of pull requests, but I'm not sure.

They have an extensive set of post-commit webhooks which you could use for post-commit functionality.

I'm looking into building a "pass-through git server" -- basically, poll the GHE API frequently to make a local clone of any repo that exists on certain GHE accounts, and then auto-clone it with custom pre-recieve and post-receive hooks. This would let us clone off the pass-through server, do our pre-receive hooks there, and push approved changes through to GHE. There doesn't seem to be any kind of standard pass-through server for git out there yet, probably because you need to know what repos to clone, which doesn't seem to have a standard git API.

这篇关于我如何添加一个自定义的Git钩子到GitHub Enterprise仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 17:26