Starting git 2.9 (June 2016), you will need to look at the new config core.hooksPath
to really be sure of the hooks folder.
git rev-parse --git-dir
/hooks won't be enough anymore.
See commit 867ad08, commit de0824e, commit bf7d977, commit 49fa52f (04 May 2016) by Ævar Arnfjörð Bjarmason (avar
).
(Merged by Junio C Hamano -- gitster
-- in commit 6675f50, 17 May 2016)
So make sure you check if git config core.hooksPath
is defined or not, as it will override the default hooks folder location.
The git config
documentation now includes:
core.hooksPath
By default Git will look for your hooks in the '$GIT_DIR/hooks
' directory.
Set this to different path, e.g. '/etc/git/hooks
', and Git will try to find your hooks in that directory, e.g. '/etc/git/hooks/pre-receive
' instead of in '$GIT_DIR/hooks/pre-receive
'.
The path can be either absolute or relative. A relative path is taken as relative to the directory where the hooks are run.
Git 2.10 (Q3 2016) uses that new core.hooksPath
setting.
So to get the effective hooks
path, you need to run:
git rev-parse --git-path hooks
From the git rev-parse
man page:
--git-path <path>
Resolve "$GIT_DIR/<path>" and takes other path relocation variables such
as $GIT_OBJECT_DIRECTORY, $GIT_INDEX_FILE... into account. For example,
if $GIT_OBJECT_DIRECTORY is set to /foo/bar then "git rev-parse
--git-path objects/abc" returns /foo/bar/abc.
See commit 9445b49 (16 Aug 2016) by Johannes Schindelin (dscho
).
(Merged by Junio C Hamano -- gitster
-- in commit d05d0e9, 19 Aug 2016)