gpt4 book ai didi

git - 是否可以在 Gitolite 中实现基于 repo 的 Hook ?

转载 作者:太空狗 更新时间:2023-10-29 14:13:00 24 4
gpt4 key购买 nike

我想在 gitolite 中实现基于 repo 的钩子(Hook)。

这可能吗?

我正在使用 gitolite 3 (g3)。

最佳答案

从 Gitolite 3.6+ 开始,可以使用“repo-specific hooks”:

  • add this line in the rc file, within the %RC block, if it's not already present, or uncomment it if it's already present and commented out:
LOCAL_CODE => "$rc{GL_ADMIN_BASE}/local",
  • uncomment the 'repo-specific-hooks' line in the rc file or add it to the ENABLE list if it doesn't exist.

  • If your rc file does not have an ENABLE list, you need to add this to the POST_COMPILE and the POST_CREATE lists. Click here for more on all this.

  • put your hooks into your gitolite-admin clone, as follows:

# on your workstation
cd /path/to/your/gitolite-admin-clone
mkdir -p local/hooks/repo-specific
  • Now add your hooks to that directory, but instead of using the git "standard" names (pre-receive, post-receive, post-update), you use descriptive names (e.g. "deploy", "RSS-post", etc).

  • add them to the repos you want them to be active in, in your conf file. For example:

repo foo
option hook.post-update = jenkins
repo bar @baz
option hook.post-update = deploy RSS-post
  • add, commit, and push the admin repo.

关于git - 是否可以在 Gitolite 中实现基于 repo 的 Hook ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29541554/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com