Variable: magit-user-githook-file
magit-user-githook-file is a customizable variable defined in
magit-git.el.
Value
"~/.emacs.d/magit-githooks"
Documentation
File containing user Git hook to Lisp hook mappings.
Magit ships with one such mapping, defined in the included file
"githooks/config", which looks like this:
[hook "magit-common-post-commit"]
event = post-commit
event = post-merge
event = post-rewrite
command = magit-run-git-hook magit-common-git-post-commit-functions
That file should not be edited by users, as those edits would be lost when Magit is updated; instead the file specified by this option, has to be used, to add additional mappings.
See the git-hook(1) and githooks(5) manpages for details about the Git part. The command should always use the "magit-run-git-hook" executable, which takes the name of the Lisp hook to be run as the first argument.
See also magit-run-hooks-from-githooks.
This variable was added, or its default value changed, in magit version 4.6.0.
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260822.1158/magit-git.el
(defcustom magit-user-githook-file (locate-user-emacs-file "magit-githooks")
"File containing user Git hook to Lisp hook mappings.
Magit ships with one such mapping, defined in the included file
\"githooks/config\", which looks like this:
[hook \"magit-common-post-commit\"]
event = post-commit
event = post-merge
event = post-rewrite
command = magit-run-git-hook magit-common-git-post-commit-functions
That file should not be edited by users, as those edits would be lost
when Magit is updated; instead the file specified by this option, has
to be used, to add additional mappings.
See the git-hook(1) and githooks(5) manpages for details about the
Git part. The command should always use the \"magit-run-git-hook\"
executable, which takes the name of the Lisp hook to be run as the
first argument.
See also `magit-run-hooks-from-githooks'."
:package-version '(magit . "4.6.0")
:group 'magit-process
:type 'file)