尝试向 gitolite 中的存储库添加新的 update.secondary 挂钩,现在 git Push 失败

发布于 2024-12-15 00:18:09 字数 223 浏览 8 评论 0原文

远程:未定义的子例程 &main::repo_rights 在 hooks/update 第 41 行调用。 远程:错误:钩子拒绝更新

为了解决这个问题,我已经从我的所有存储库中删除了更新钩子,但我知道它们现在是开放的。

我运行了 gl-setup,我的机器上可能有混合版本的 gitolite。我担心我运行的 gl-setup 版本与我当前运行的版本不同。我不知道该怎么说。请帮忙。 :-(

remote: Undefined subroutine &main::repo_rights called at hooks/update line 41.
remote: error: hook declined to update

I have removed the update hook from all of my repos in order to get around this, but I know that they are now wide open.

I ran gl-setup, and I may have mixed versions of gitolite on my machine. I am afraid that I ran the gl-setup from a version that is different than the one I am running currently. I am not sure how to tell. Please help. :-(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不再见 2024-12-22 00:18:09

更新,对于更新版本的 Gitolite(即 V3.x 或更高版本),官方文档为:“添加您自己的更新挂钩",它使用 VREF(虚拟参考)

将此行添加到 %RC 块内的 rc 文件中(如果尚未存在),或者取消注释(如果已存在并已注释掉):

LOCAL_CODE =>; “$ENV{HOME}/本地”,

将更新挂钩复制到该目录下名为 VREF 的子目录,并为其指定合适的名称(假设为“crlf”):

# 登录服务器上的 gitolite 托管用户,然后:
cd $HOME
mkdir -p 本地/VREF
cp your-crlf-update-hook local/VREF/crlf
chmod +x 本地/VREF/crlf

在您的 gitolite-admin 克隆中,编辑 conf/gitolite.conf 并添加如下行:

<前><代码>- VREF/crlf = @all

每个应该有“更新”挂钩的存储库。

或者,您可以简单地将其添加到 gitolite.conf 文件的末尾:

repo @all
    - VREF/crlf = @all

无论哪种方式,将更改添加/提交/推送到 gitolite-admin 存储库。

Update, for a more recent version of Gitolite (namely a V3.x or more), the official documentation would be: "adding your own update hooks", and it uses VREFs (virtual refs).

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 => "$ENV{HOME}/local",

copy your update hook to a subdirectory called VREF under this directory, giving it a suitable name (let's say "crlf"):

# log on to gitolite hosting user on the server, then:
cd $HOME
mkdir -p local/VREF
cp your-crlf-update-hook local/VREF/crlf
chmod +x local/VREF/crlf

in your gitolite-admin clone, edit conf/gitolite.conf and add lines like this:

-   VREF/crlf       =   @all

to each repo that should have that "update" hook.

Alternatively, you can simply add this at the end of the gitolite.conf file:

repo @all
    -   VREF/crlf       =   @all

Either way, add/commit/push the change to the gitolite-admin repo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文