github服务器端git钩子(即提交前和提交后) [英] github server-side git hooks (i.e. pre-commit and post-commit)

查看:170
本文介绍了github服务器端git钩子(即提交前和提交后)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在SO和Web上寻找答案,但在github(相对于webhooks)上如何设置服务器端git钩子一无所获.有办法吗?

I've looked around the answers on SO, and the web, and I can't see anything on how to set up a server-side git hook on github (as opposed to webhooks). Is there a way to do this?

或者,是否可以进行设置,以使.git/hooks在克隆时是工作树的一部分的符号链接??

Or alternatively, is there a way to set it up so that .git/hooks is a symlink to a part of the working tree at the time of cloning?

我应该补充一点,这是一个内部托管的github服务器.

I should add that this is an internally-hosted github server.

推荐答案

出于显而易见的原因,GitHub不允许您在其服务器上执行任意代码作为Git挂钩的一部分.他们允许的唯一挂钩是通过其网络钩子或集成的第三方服务.

For obvious reasons, GitHub won’t allow you to execute arbitrary code on their servers as part of Git hooks. The only hooking they allow is through their webhooks or the integrated third-party services.

如果您需要运行一些自定义代码,则必须将其托管在某个地方,并设置一个Webhook在您自己的服务器上运行它.

If you need to run some custom code, you will have to host that somewhere and set up a webhook to run it on your own server.

这篇关于github服务器端git钩子(即提交前和提交后)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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