Skip to content

Commit 501d3cd

Browse files
rudisgitster
authored andcommitted
githooks.txt: clarify push hooks are always executed in $GIT_DIR
Listing the specific hooks might feel verbose but without it the reader is left to wonder which hooks are triggered during the push. Something which is not immediately obvious when only trying to find out where the hook is executed. Signed-off-by: Simon Ruderich <[email protected]> Reviewed-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 49800c9 commit 501d3cd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Documentation/githooks.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ changed via the `core.hooksPath` configuration variable (see
2222
linkgit:git-config[1]).
2323

2424
Before Git invokes a hook, it changes its working directory to either
25-
the root of the working tree in a non-bare repository, or to the
26-
$GIT_DIR in a bare repository.
25+
$GIT_DIR in a bare repository or the root of the working tree in a non-bare
26+
repository. An exception are hooks triggered during a push ('pre-receive',
27+
'update', 'post-receive', 'post-update', 'push-to-checkout') which are always
28+
executed in $GIT_DIR.
2729

2830
Hooks can get their arguments via the environment, command-line
2931
arguments, and stdin. See the documentation for each hook below for

0 commit comments

Comments
 (0)