Skip to content

Commit c8ddd2a

Browse files
committed
Merge branch 'sr/hooks-cwd-doc'
* sr/hooks-cwd-doc: githooks.txt: clarify push hooks are always executed in $GIT_DIR
2 parents 9f3e2fe + 501d3cd commit c8ddd2a

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)