缺少git文件钩子/ post-receive.sample

时间:2015-10-05 20:41:58

标签: git git-post-receive

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

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

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

1 个答案:

答案 0 :(得分:6)

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

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>