diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 17 | ||||
-rw-r--r-- | Documentation/githooks.txt | 12 |
2 files changed, 25 insertions, 4 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 2cd6bdd7d2..7f8c119b2f 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -618,6 +618,23 @@ core.attributesFile:: $XDG_CONFIG_HOME/git/attributes. If $XDG_CONFIG_HOME is either not set or empty, $HOME/.config/git/attributes is used instead. +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 (see +the "DESCRIPTION" section of linkgit:githooks[5]). ++ +This configuration variable is useful in cases where you'd like to +centrally configure your Git hooks instead of configuring them on a +per-repository basis, or as a more flexible and centralized +alternative to having an `init.templateDir` where you've changed +default hooks. + core.editor:: Commands such as `commit` and `tag` that lets you edit messages by launching an editor uses the value of this diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 30495745a0..d82e912e55 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -7,15 +7,19 @@ githooks - Hooks used by Git SYNOPSIS -------- -$GIT_DIR/hooks/* +$GIT_DIR/hooks/* (or \`git config core.hooksPath`/*) DESCRIPTION ----------- -Hooks are programs you can place in the `$GIT_DIR/hooks` directory to -trigger actions at certain points in git's execution. Hooks that don't -have the executable bit set are ignored. +Hooks are programs you can place in a hooks directory to trigger +actions at certain points in git's execution. Hooks that don't have +the executable bit set are ignored. + +By default the hooks directory is `$GIT_DIR/hooks`, but that can be +changed via the `core.hooksPath` configuration variable (see +linkgit:git-config[1]). Before Git invokes a hook, it changes its working directory to either the root of the working tree in a non-bare repository, or to the |