@@ -26,8 +26,11 @@ executable by default.
26
26
27
27
This document describes the currently defined hooks.
28
28
29
+ HOOKS
30
+ -----
31
+
29
32
applypatch-msg
30
- --------------
33
+ ~~~~~~~~~~~~~~
31
34
32
35
This hook is invoked by 'git-am' script. It takes a single
33
36
parameter, the name of the file that holds the proposed commit
@@ -43,7 +46,7 @@ The default 'applypatch-msg' hook, when enabled, runs the
43
46
'commit-msg' hook, if the latter is enabled.
44
47
45
48
pre-applypatch
46
- --------------
49
+ ~~~~~~~~~~~~~~
47
50
48
51
This hook is invoked by 'git-am'. It takes no parameter, and is
49
52
invoked after the patch is applied, but before a commit is made.
@@ -58,7 +61,7 @@ The default 'pre-applypatch' hook, when enabled, runs the
58
61
'pre-commit' hook, if the latter is enabled.
59
62
60
63
post-applypatch
61
- ---------------
64
+ ~~~~~~~~~~~~~~~
62
65
63
66
This hook is invoked by 'git-am'. It takes no parameter,
64
67
and is invoked after the patch is applied and a commit is made.
@@ -67,7 +70,7 @@ This hook is meant primarily for notification, and cannot affect
67
70
the outcome of 'git-am'.
68
71
69
72
pre-commit
70
- ----------
73
+ ~~~~~~~~~~
71
74
72
75
This hook is invoked by 'git-commit', and can be bypassed
73
76
with `\--no-verify` option. It takes no parameter, and is
@@ -84,7 +87,7 @@ variable `GIT_EDITOR=:` if the command will not bring up an editor
84
87
to modify the commit message.
85
88
86
89
prepare-commit-msg
87
- ------------------
90
+ ~~~~~~~~~~~~~~~~~~
88
91
89
92
This hook is invoked by 'git-commit' right after preparing the
90
93
default log message, and before the editor is started.
@@ -109,7 +112,7 @@ The sample `prepare-commit-msg` hook that comes with git comments
109
112
out the `Conflicts:` part of a merge's commit message.
110
113
111
114
commit-msg
112
- ----------
115
+ ~~~~~~~~~~
113
116
114
117
This hook is invoked by 'git-commit', and can be bypassed
115
118
with `\--no-verify` option. It takes a single parameter, the
@@ -126,7 +129,7 @@ The default 'commit-msg' hook, when enabled, detects duplicate
126
129
"Signed-off-by" lines, and aborts the commit if one is found.
127
130
128
131
post-commit
129
- -----------
132
+ ~~~~~~~~~~~
130
133
131
134
This hook is invoked by 'git-commit'. It takes no
132
135
parameter, and is invoked after a commit is made.
@@ -135,14 +138,14 @@ This hook is meant primarily for notification, and cannot affect
135
138
the outcome of 'git-commit'.
136
139
137
140
pre-rebase
138
- ----------
141
+ ~~~~~~~~~~
139
142
140
143
This hook is called by 'git-rebase' and can be used to prevent a branch
141
144
from getting rebased.
142
145
143
146
144
147
post-checkout
145
- -----------
148
+ ~~~~~~~~~~~~~
146
149
147
150
This hook is invoked when a 'git-checkout' is run after having updated the
148
151
worktree. The hook is given three parameters: the ref of the previous HEAD,
@@ -160,7 +163,7 @@ differences from the previous HEAD if different, or set working dir metadata
160
163
properties.
161
164
162
165
post-merge
163
- -----------
166
+ ~~~~~~~~~~
164
167
165
168
This hook is invoked by 'git-merge', which happens when a 'git-pull'
166
169
is done on a local repository. The hook takes a single parameter, a status
@@ -175,7 +178,7 @@ for an example of how to do this.
175
178
176
179
[[pre-receive]]
177
180
pre-receive
178
- -----------
181
+ ~~~~~~~~~~~
179
182
180
183
This hook is invoked by 'git-receive-pack' on the remote repository,
181
184
which happens when a 'git-push' is done on a local repository.
@@ -204,7 +207,7 @@ for the user.
204
207
205
208
[[update]]
206
209
update
207
- ------
210
+ ~~~~~~
208
211
209
212
This hook is invoked by 'git-receive-pack' on the remote repository,
210
213
which happens when a 'git-push' is done on a local repository.
@@ -247,7 +250,7 @@ unannotated tags to be pushed.
247
250
248
251
[[post-receive]]
249
252
post-receive
250
- ------------
253
+ ~~~~~~~~~~~~
251
254
252
255
This hook is invoked by 'git-receive-pack' on the remote repository,
253
256
which happens when a 'git-push' is done on a local repository.
@@ -277,7 +280,7 @@ emails.
277
280
278
281
[[post-update]]
279
282
post-update
280
- -----------
283
+ ~~~~~~~~~~~
281
284
282
285
This hook is invoked by 'git-receive-pack' on the remote repository,
283
286
which happens when a 'git-push' is done on a local repository.
@@ -308,7 +311,7 @@ Both standard output and standard error output are forwarded to
308
311
for the user.
309
312
310
313
pre-auto-gc
311
- -----------
314
+ ~~~~~~~~~~~
312
315
313
316
This hook is invoked by 'git-gc --auto'. It takes no parameter, and
314
317
exiting with non-zero status from this script causes the 'git-gc --auto'
0 commit comments