ubuntu - Gitlab在组的所有存储库中同步文件夹 "hooks"

标签 ubuntu ubuntu-14.04 gitlab gitlab-omnibus

我在我的服务器上本地设置了 Gitlab。我注意到,当我向某个存储库中的“接收后”文件添加一些代码时,所有更改都适用于该组中的所有其他存储库。

如何阻止它?

最佳答案

检查“Custom Git hooks setup”:

Normally, Git hooks are placed in the repository or project's hooks directory. GitLab creates a symlink from each project's hooks directory to the gitlab-shell hooks directory for ease of maintenance between gitlab-shell upgrades.



这解释了为什么您的钩子(Hook)似乎被传播到该组的所有存储库。

Follow the steps below to set up a custom hook:

  • Pick a project that needs a custom Git hook.
  • On the GitLab server, navigate to the project's repository directory. For an installation from source the path is usually /home/git/repositories/<group>/<project>.git.
    For Omnibus installs the path is usually /var/opt/gitlab/git-data/repositories/<group>/<project>.git.
  • Create a new directory in this location called custom_hooks.
  • Inside the new custom_hooks directory, create a file with a name matching the hook type.
    For a pre-receive hook the file name should be pre-receive with no extension.
  • Make the hook file executable and make sure it's owned by git.
  • Write the code to make the Git hook function as expected

关于ubuntu - Gitlab在组的所有存储库中同步文件夹 "hooks",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42584670/

相关文章:

linux - + 2000 0")syntax error: invalid arithmetic operator (error token is "

Ubuntu 14.04 上的 Redis

ruby-on-rails - Rails 中的 Gitlab 密码重置

android - linux eclipse...R 无法解析

java - 在 Ubuntu 14.04 上启动 Pycharm 时出错

ssh - VPN,SSH,GitLab和Composer更新

Gitlab:是否可以创建从我的分支到同一项目的另一个分支的 merge 请求

eclipse - 在 ubuntu 上使用 flex

docker - 问题 Docker 上没有这样的文件或目录

c - 在 Ubuntu 下从串口读取和写入 USB 秤