【问题标题】:Missing git file hooks/post-receive.sample缺少 git 文件挂钩/post-receive.sample
【发布时间】:2015-10-05 20:41:58
【问题描述】:

我在 CentOs 6 服务器上使用 git 1.7.1,当我在 my_repo.git 上运行 git --bare init 时,我检查了 my_repo.git/hooks,我可以看到所有的钩子,包括 post-receive.sample.

现在我在 Centos 7 服务器上使用 git 2.4.1,并且 post-receive.sample 文件丢失,所有其他钩子都在那里,但不是我需要的。

我知道我可以从以前的 repo 复制文件,然后根据需要更改内容,但我想知道为什么没有像以前那样生成 post-receive.sample。

【问题讨论】:

    标签: git git-post-receive


    【解决方案1】:

    显然,post-receive.sample 在提交 8d714b11df2b65e5f4272c1616e561930010be90 中被删除:

    commit 8d714b11df2b65e5f4272c1616e561930010be90
    Author: Gerrit Pape <pape@smarden.org>
    Date:   Tue Sep 27 11:56:53 2011 +0000
    
        templates/hooks--*: remove sample hooks without any functionality
    
        Remove the sample post-commit and post-receive hooks.  The sample
        post-commit doesn't contain any sample functionality and the comments do
        not provide more information than already found in the documentation.
        The sample post-receive hooks doesn't provide any sample functionality
        either and refers in the comments to a contrib hook that might be
        installed in different locations on different systems, which isn't that
        helpful.
    
        Signed-off-by: Gerrit Pape <pape@smarden.org>
        Signed-off-by: Junio C Hamano <gitster@pobox.com>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-31
      • 2020-05-11
      • 2018-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-18
      • 2011-11-16
      相关资源
      最近更新 更多