【问题标题】:where is the location of client side git hooks in server服务器中客户端 git 钩子的位置在哪里
【发布时间】:2017-05-27 14:55:04
【问题描述】:

我想部署我自己版本的 git 客户端钩子。为此,我需要知道客户端挂钩是从客户端系统生成还是从服务器克隆。 如果是从服务端克隆的,客户端的钩子在什么位置?

【问题讨论】:

    标签: linux git server gitlab


    【解决方案1】:

    挂钩位置在您克隆文件夹中的.git 文件夹下

    .git
    ├── branches
    ├── COMMIT_EDITMSG
    ├── config
    ├── description
    ├── HEAD
    ├── hooks
    ├── index
    ├── info
    ├── logs
    ├── objects
    └── refs
    

    有一个文件夹hooks,您可以在其中找到postpre 挂钩。

    ├── applypatch-msg.sample
    ├── commit-msg.sample
    ├── post-update.sample
    ├── pre-applypatch.sample
    ├── pre-commit.sample
    ├── prepare-commit-msg.sample
    ├── pre-push.sample
    ├── pre-rebase.sample
    └── update.sample
    

    将 .sample 文件重命名为喜欢 post-update.samplepost-update 以运行 prepost 挂钩。

    【讨论】:

      【解决方案2】:

      客户端钩子不存储在服务器中。服务器与 git 中的客户端钩子无关。即客户端钩子和服务器端钩子不是相互关联的。但是,它们是由您自己的本地系统在您的本地存储库中生成的。
      简而言之,客户端 git hooks 与服务器无关,也不存储在那里。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-11-19
        • 1970-01-01
        • 2013-08-10
        • 2014-02-20
        • 1970-01-01
        • 1970-01-01
        • 2023-03-19
        相关资源
        最近更新 更多