In Git 2.9, the
configuration option core.hooksPath
specifies a custom hooks directory.
Move your hooks to a hooks
tracked directory in your repository. Then, configure each instance of the repository to use the tracked hooks
instead of $GIT_DIR/hooks
:
git config core.hooksPath hooks
In general, the path may be absolute, or relative to the directory where the hooks are run (usually the working tree root; see DESCRIPTION section of man githooks
).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…