将git挂钩放入存储库 [英] Putting git hooks into repository

查看:131
本文介绍了将git挂钩放入存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它被认为是一种不好的做法 - 将.git / hooks放入项目存储库(例如使用符号链接)。如果是的话,什么是最好的方式来提供不同的git用户相同的钩子?

Is it considered to be a bad practice - to put .git/hooks into the projects repository (using symlinks, for example). If yes, what is the best way to deliver same hooks to different git users?

推荐答案

不,将它们放入存储库是很好,我甚至建议这样做(如果它们对其他人有用)。用户必须明确地启用它们(正如你所说,例如通过symlinking),这一方面有点痛苦,但另一方面保护用户在未经他们同意的情况下运行任意代码。

No, putting them into the repository is fine, I’d even suggest doing so (if they are useful for others as well). The user has to explicitly enable them (as you said, for example by symlinking), which is on one hand a bit of a pain, but protects users on the other hand from running arbitrary code without their consent.

这篇关于将git挂钩放入存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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