1GITHOOKS(5) Git Manual GITHOOKS(5)
2
3
4
6 githooks - Hooks used by Git
7
9 $GIT_DIR/hooks/* (or `git config core.hooksPath`/*)
10
12 Hooks are programs you can place in a hooks directory to trigger
13 actions at certain points in git’s execution. Hooks that don’t have the
14 executable bit set are ignored.
15
16 By default the hooks directory is $GIT_DIR/hooks, but that can be
17 changed via the core.hooksPath configuration variable (see git-
18 config(1)).
19
20 Before Git invokes a hook, it changes its working directory to either
21 $GIT_DIR in a bare repository or the root of the working tree in a
22 non-bare repository. An exception are hooks triggered during a push
23 (pre-receive, update, post-receive, post-update, push-to-checkout)
24 which are always executed in $GIT_DIR.
25
26 Environment variables, such as GIT_DIR, GIT_WORK_TREE, etc., are
27 exported so that Git commands run by the hook can correctly locate the
28 repository. If your hook needs to invoke Git commands in a foreign
29 repository or in a different working tree of the same repository, then
30 it should clear these environment variables so they do not interfere
31 with Git operations at the foreign location. For example:
32
33 local_desc=$(git describe)
34 foreign_desc=$(unset $(git rev-parse --local-env-vars); git -C ../foreign-repo describe)
35
36 Hooks can get their arguments via the environment, command-line
37 arguments, and stdin. See the documentation for each hook below for
38 details.
39
40 git init may copy hooks to the new repository, depending on its
41 configuration. See the "TEMPLATE DIRECTORY" section in git-init(1) for
42 details. When the rest of this document refers to "default hooks" it’s
43 talking about the default template shipped with Git.
44
45 The currently supported hooks are described below.
46
48 applypatch-msg
49 This hook is invoked by git-am(1). It takes a single parameter, the
50 name of the file that holds the proposed commit log message. Exiting
51 with a non-zero status causes git am to abort before applying the
52 patch.
53
54 The hook is allowed to edit the message file in place, and can be used
55 to normalize the message into some project standard format. It can also
56 be used to refuse the commit after inspecting the message file.
57
58 The default applypatch-msg hook, when enabled, runs the commit-msg
59 hook, if the latter is enabled.
60
61 pre-applypatch
62 This hook is invoked by git-am(1). It takes no parameter, and is
63 invoked after the patch is applied, but before a commit is made.
64
65 If it exits with non-zero status, then the working tree will not be
66 committed after applying the patch.
67
68 It can be used to inspect the current working tree and refuse to make a
69 commit if it does not pass certain tests.
70
71 The default pre-applypatch hook, when enabled, runs the pre-commit
72 hook, if the latter is enabled.
73
74 post-applypatch
75 This hook is invoked by git-am(1). It takes no parameter, and is
76 invoked after the patch is applied and a commit is made.
77
78 This hook is meant primarily for notification, and cannot affect the
79 outcome of git am.
80
81 pre-commit
82 This hook is invoked by git-commit(1), and can be bypassed with the
83 --no-verify option. It takes no parameters, and is invoked before
84 obtaining the proposed commit log message and making a commit. Exiting
85 with a non-zero status from this script causes the git commit command
86 to abort before creating a commit.
87
88 The default pre-commit hook, when enabled, catches introduction of
89 lines with trailing whitespaces and aborts the commit when such a line
90 is found.
91
92 All the git commit hooks are invoked with the environment variable
93 GIT_EDITOR=: if the command will not bring up an editor to modify the
94 commit message.
95
96 The default pre-commit hook, when enabled—and with the
97 hooks.allownonascii config option unset or set to false—prevents the
98 use of non-ASCII filenames.
99
100 pre-merge-commit
101 This hook is invoked by git-merge(1), and can be bypassed with the
102 --no-verify option. It takes no parameters, and is invoked after the
103 merge has been carried out successfully and before obtaining the
104 proposed commit log message to make a commit. Exiting with a non-zero
105 status from this script causes the git merge command to abort before
106 creating a commit.
107
108 The default pre-merge-commit hook, when enabled, runs the pre-commit
109 hook, if the latter is enabled.
110
111 This hook is invoked with the environment variable GIT_EDITOR=: if the
112 command will not bring up an editor to modify the commit message.
113
114 If the merge cannot be carried out automatically, the conflicts need to
115 be resolved and the result committed separately (see git-merge(1)). At
116 that point, this hook will not be executed, but the pre-commit hook
117 will, if it is enabled.
118
119 prepare-commit-msg
120 This hook is invoked by git-commit(1) right after preparing the default
121 log message, and before the editor is started.
122
123 It takes one to three parameters. The first is the name of the file
124 that contains the commit log message. The second is the source of the
125 commit message, and can be: message (if a -m or -F option was given);
126 template (if a -t option was given or the configuration option
127 commit.template is set); merge (if the commit is a merge or a
128 .git/MERGE_MSG file exists); squash (if a .git/SQUASH_MSG file exists);
129 or commit, followed by a commit object name (if a -c, -C or --amend
130 option was given).
131
132 If the exit status is non-zero, git commit will abort.
133
134 The purpose of the hook is to edit the message file in place, and it is
135 not suppressed by the --no-verify option. A non-zero exit means a
136 failure of the hook and aborts the commit. It should not be used as a
137 replacement for the pre-commit hook.
138
139 The sample prepare-commit-msg hook that comes with Git removes the help
140 message found in the commented portion of the commit template.
141
142 commit-msg
143 This hook is invoked by git-commit(1) and git-merge(1), and can be
144 bypassed with the --no-verify option. It takes a single parameter, the
145 name of the file that holds the proposed commit log message. Exiting
146 with a non-zero status causes the command to abort.
147
148 The hook is allowed to edit the message file in place, and can be used
149 to normalize the message into some project standard format. It can also
150 be used to refuse the commit after inspecting the message file.
151
152 The default commit-msg hook, when enabled, detects duplicate
153 Signed-off-by trailers, and aborts the commit if one is found.
154
155 post-commit
156 This hook is invoked by git-commit(1). It takes no parameters, and is
157 invoked after a commit is made.
158
159 This hook is meant primarily for notification, and cannot affect the
160 outcome of git commit.
161
162 pre-rebase
163 This hook is called by git-rebase(1) and can be used to prevent a
164 branch from getting rebased. The hook may be called with one or two
165 parameters. The first parameter is the upstream from which the series
166 was forked. The second parameter is the branch being rebased, and is
167 not set when rebasing the current branch.
168
169 post-checkout
170 This hook is invoked when a git-checkout(1) or git-switch(1) is run
171 after having updated the worktree. The hook is given three parameters:
172 the ref of the previous HEAD, the ref of the new HEAD (which may or may
173 not have changed), and a flag indicating whether the checkout was a
174 branch checkout (changing branches, flag=1) or a file checkout
175 (retrieving a file from the index, flag=0). This hook cannot affect the
176 outcome of git switch or git checkout, other than that the hook’s exit
177 status becomes the exit status of these two commands.
178
179 It is also run after git-clone(1), unless the --no-checkout (-n) option
180 is used. The first parameter given to the hook is the null-ref, the
181 second the ref of the new HEAD and the flag is always 1. Likewise for
182 git worktree add unless --no-checkout is used.
183
184 This hook can be used to perform repository validity checks,
185 auto-display differences from the previous HEAD if different, or set
186 working dir metadata properties.
187
188 post-merge
189 This hook is invoked by git-merge(1), which happens when a git pull is
190 done on a local repository. The hook takes a single parameter, a status
191 flag specifying whether or not the merge being done was a squash merge.
192 This hook cannot affect the outcome of git merge and is not executed,
193 if the merge failed due to conflicts.
194
195 This hook can be used in conjunction with a corresponding pre-commit
196 hook to save and restore any form of metadata associated with the
197 working tree (e.g.: permissions/ownership, ACLS, etc). See
198 contrib/hooks/setgitperms.perl for an example of how to do this.
199
200 pre-push
201 This hook is called by git-push(1) and can be used to prevent a push
202 from taking place. The hook is called with two parameters which provide
203 the name and location of the destination remote, if a named remote is
204 not being used both values will be the same.
205
206 Information about what is to be pushed is provided on the hook’s
207 standard input with lines of the form:
208
209 <local ref> SP <local object name> SP <remote ref> SP <remote object name> LF
210
211 For instance, if the command git push origin master:foreign were run
212 the hook would receive a line like the following:
213
214 refs/heads/master 67890 refs/heads/foreign 12345
215
216 although the full object name would be supplied. If the foreign ref
217 does not yet exist the <remote object name> will be the all-zeroes
218 object name. If a ref is to be deleted, the <local ref> will be
219 supplied as (delete) and the <local object name> will be the all-zeroes
220 object name. If the local commit was specified by something other than
221 a name which could be expanded (such as HEAD~, or an object name) it
222 will be supplied as it was originally given.
223
224 If this hook exits with a non-zero status, git push will abort without
225 pushing anything. Information about why the push is rejected may be
226 sent to the user by writing to standard error.
227
228 pre-receive
229 This hook is invoked by git-receive-pack(1) when it reacts to git push
230 and updates reference(s) in its repository. Just before starting to
231 update refs on the remote repository, the pre-receive hook is invoked.
232 Its exit status determines the success or failure of the update.
233
234 This hook executes once for the receive operation. It takes no
235 arguments, but for each ref to be updated it receives on standard input
236 a line of the format:
237
238 <old-value> SP <new-value> SP <ref-name> LF
239
240 where <old-value> is the old object name stored in the ref, <new-value>
241 is the new object name to be stored in the ref and <ref-name> is the
242 full name of the ref. When creating a new ref, <old-value> is the
243 all-zeroes object name.
244
245 If the hook exits with non-zero status, none of the refs will be
246 updated. If the hook exits with zero, updating of individual refs can
247 still be prevented by the update hook.
248
249 Both standard output and standard error output are forwarded to git
250 send-pack on the other end, so you can simply echo messages for the
251 user.
252
253 The number of push options given on the command line of git push
254 --push-option=... can be read from the environment variable
255 GIT_PUSH_OPTION_COUNT, and the options themselves are found in
256 GIT_PUSH_OPTION_0, GIT_PUSH_OPTION_1,... If it is negotiated to not use
257 the push options phase, the environment variables will not be set. If
258 the client selects to use push options, but doesn’t transmit any, the
259 count variable will be set to zero, GIT_PUSH_OPTION_COUNT=0.
260
261 See the section on "Quarantine Environment" in git-receive-pack(1) for
262 some caveats.
263
264 update
265 This hook is invoked by git-receive-pack(1) when it reacts to git push
266 and updates reference(s) in its repository. Just before updating the
267 ref on the remote repository, the update hook is invoked. Its exit
268 status determines the success or failure of the ref update.
269
270 The hook executes once for each ref to be updated, and takes three
271 parameters:
272
273 • the name of the ref being updated,
274
275 • the old object name stored in the ref,
276
277 • and the new object name to be stored in the ref.
278
279 A zero exit from the update hook allows the ref to be updated. Exiting
280 with a non-zero status prevents git receive-pack from updating that
281 ref.
282
283 This hook can be used to prevent forced update on certain refs by
284 making sure that the object name is a commit object that is a
285 descendant of the commit object named by the old object name. That is,
286 to enforce a "fast-forward only" policy.
287
288 It could also be used to log the old..new status. However, it does not
289 know the entire set of branches, so it would end up firing one e-mail
290 per ref when used naively, though. The post-receive hook is more suited
291 to that.
292
293 In an environment that restricts the users' access only to git commands
294 over the wire, this hook can be used to implement access control
295 without relying on filesystem ownership and group membership. See git-
296 shell(1) for how you might use the login shell to restrict the user’s
297 access to only git commands.
298
299 Both standard output and standard error output are forwarded to git
300 send-pack on the other end, so you can simply echo messages for the
301 user.
302
303 The default update hook, when enabled—and with hooks.allowunannotated
304 config option unset or set to false—prevents unannotated tags from
305 being pushed.
306
307 proc-receive
308 This hook is invoked by git-receive-pack(1). If the server has set the
309 multi-valued config variable receive.procReceiveRefs, and the commands
310 sent to receive-pack have matching reference names, these commands will
311 be executed by this hook, instead of by the internal execute_commands()
312 function. This hook is responsible for updating the relevant references
313 and reporting the results back to receive-pack.
314
315 This hook executes once for the receive operation. It takes no
316 arguments, but uses a pkt-line format protocol to communicate with
317 receive-pack to read commands, push-options and send results. In the
318 following example for the protocol, the letter S stands for
319 receive-pack and the letter H stands for this hook.
320
321 # Version and features negotiation.
322 S: PKT-LINE(version=1\0push-options atomic...)
323 S: flush-pkt
324 H: PKT-LINE(version=1\0push-options...)
325 H: flush-pkt
326
327 # Send commands from server to the hook.
328 S: PKT-LINE(<old-oid> <new-oid> <ref>)
329 S: ... ...
330 S: flush-pkt
331 # Send push-options only if the 'push-options' feature is enabled.
332 S: PKT-LINE(push-option)
333 S: ... ...
334 S: flush-pkt
335
336 # Receive results from the hook.
337 # OK, run this command successfully.
338 H: PKT-LINE(ok <ref>)
339 # NO, I reject it.
340 H: PKT-LINE(ng <ref> <reason>)
341 # Fall through, let 'receive-pack' execute it.
342 H: PKT-LINE(ok <ref>)
343 H: PKT-LINE(option fall-through)
344 # OK, but has an alternate reference. The alternate reference name
345 # and other status can be given in option directives.
346 H: PKT-LINE(ok <ref>)
347 H: PKT-LINE(option refname <refname>)
348 H: PKT-LINE(option old-oid <old-oid>)
349 H: PKT-LINE(option new-oid <new-oid>)
350 H: PKT-LINE(option forced-update)
351 H: ... ...
352 H: flush-pkt
353
354 Each command for the proc-receive hook may point to a pseudo-reference
355 and always has a zero-old as its old-oid, while the proc-receive hook
356 may update an alternate reference and the alternate reference may exist
357 already with a non-zero old-oid. For this case, this hook will use
358 "option" directives to report extended attributes for the reference
359 given by the leading "ok" directive.
360
361 The report of the commands of this hook should have the same order as
362 the input. The exit status of the proc-receive hook only determines the
363 success or failure of the group of commands sent to it, unless atomic
364 push is in use.
365
366 post-receive
367 This hook is invoked by git-receive-pack(1) when it reacts to git push
368 and updates reference(s) in its repository. It executes on the remote
369 repository once after all the refs have been updated.
370
371 This hook executes once for the receive operation. It takes no
372 arguments, but gets the same information as the pre-receive hook does
373 on its standard input.
374
375 This hook does not affect the outcome of git receive-pack, as it is
376 called after the real work is done.
377
378 This supersedes the post-update hook in that it gets both old and new
379 values of all the refs in addition to their names.
380
381 Both standard output and standard error output are forwarded to git
382 send-pack on the other end, so you can simply echo messages for the
383 user.
384
385 The default post-receive hook is empty, but there is a sample script
386 post-receive-email provided in the contrib/hooks directory in Git
387 distribution, which implements sending commit emails.
388
389 The number of push options given on the command line of git push
390 --push-option=... can be read from the environment variable
391 GIT_PUSH_OPTION_COUNT, and the options themselves are found in
392 GIT_PUSH_OPTION_0, GIT_PUSH_OPTION_1,... If it is negotiated to not use
393 the push options phase, the environment variables will not be set. If
394 the client selects to use push options, but doesn’t transmit any, the
395 count variable will be set to zero, GIT_PUSH_OPTION_COUNT=0.
396
397 post-update
398 This hook is invoked by git-receive-pack(1) when it reacts to git push
399 and updates reference(s) in its repository. It executes on the remote
400 repository once after all the refs have been updated.
401
402 It takes a variable number of parameters, each of which is the name of
403 ref that was actually updated.
404
405 This hook is meant primarily for notification, and cannot affect the
406 outcome of git receive-pack.
407
408 The post-update hook can tell what are the heads that were pushed, but
409 it does not know what their original and updated values are, so it is a
410 poor place to do log old..new. The post-receive hook does get both
411 original and updated values of the refs. You might consider it instead
412 if you need them.
413
414 When enabled, the default post-update hook runs git update-server-info
415 to keep the information used by dumb transports (e.g., HTTP) up to
416 date. If you are publishing a Git repository that is accessible via
417 HTTP, you should probably enable this hook.
418
419 Both standard output and standard error output are forwarded to git
420 send-pack on the other end, so you can simply echo messages for the
421 user.
422
423 reference-transaction
424 This hook is invoked by any Git command that performs reference
425 updates. It executes whenever a reference transaction is prepared,
426 committed or aborted and may thus get called multiple times. The hook
427 does not cover symbolic references (but that may change in the future).
428
429 The hook takes exactly one argument, which is the current state the
430 given reference transaction is in:
431
432 • "prepared": All reference updates have been queued to the
433 transaction and references were locked on disk.
434
435 • "committed": The reference transaction was committed and all
436 references now have their respective new value.
437
438 • "aborted": The reference transaction was aborted, no changes were
439 performed and the locks have been released.
440
441 For each reference update that was added to the transaction, the hook
442 receives on standard input a line of the format:
443
444 <old-value> SP <new-value> SP <ref-name> LF
445
446 where <old-value> is the old object name passed into the reference
447 transaction, <new-value> is the new object name to be stored in the ref
448 and <ref-name> is the full name of the ref. When force updating the
449 reference regardless of its current value or when the reference is to
450 be created anew, <old-value> is the all-zeroes object name. To
451 distinguish these cases, you can inspect the current value of
452 <ref-name> via git rev-parse.
453
454 The exit status of the hook is ignored for any state except for the
455 "prepared" state. In the "prepared" state, a non-zero exit status will
456 cause the transaction to be aborted. The hook will not be called with
457 "aborted" state in that case.
458
459 push-to-checkout
460 This hook is invoked by git-receive-pack(1) when it reacts to git push
461 and updates reference(s) in its repository, and when the push tries to
462 update the branch that is currently checked out and the
463 receive.denyCurrentBranch configuration variable is set to
464 updateInstead. Such a push by default is refused if the working tree
465 and the index of the remote repository has any difference from the
466 currently checked out commit; when both the working tree and the index
467 match the current commit, they are updated to match the newly pushed
468 tip of the branch. This hook is to be used to override the default
469 behaviour.
470
471 The hook receives the commit with which the tip of the current branch
472 is going to be updated. It can exit with a non-zero status to refuse
473 the push (when it does so, it must not modify the index or the working
474 tree). Or it can make any necessary changes to the working tree and to
475 the index to bring them to the desired state when the tip of the
476 current branch is updated to the new commit, and exit with a zero
477 status.
478
479 For example, the hook can simply run git read-tree -u -m HEAD "$1" in
480 order to emulate git fetch that is run in the reverse direction with
481 git push, as the two-tree form of git read-tree -u -m is essentially
482 the same as git switch or git checkout that switches branches while
483 keeping the local changes in the working tree that do not interfere
484 with the difference between the branches.
485
486 pre-auto-gc
487 This hook is invoked by git gc --auto (see git-gc(1)). It takes no
488 parameter, and exiting with non-zero status from this script causes the
489 git gc --auto to abort.
490
491 post-rewrite
492 This hook is invoked by commands that rewrite commits (git-commit(1)
493 when called with --amend and git-rebase(1); however, full-history
494 (re)writing tools like git-fast-import(1) or git-filter-repo[1]
495 typically do not call it!). Its first argument denotes the command it
496 was invoked by: currently one of amend or rebase. Further
497 command-dependent arguments may be passed in the future.
498
499 The hook receives a list of the rewritten commits on stdin, in the
500 format
501
502 <old-object-name> SP <new-object-name> [ SP <extra-info> ] LF
503
504 The extra-info is again command-dependent. If it is empty, the
505 preceding SP is also omitted. Currently, no commands pass any
506 extra-info.
507
508 The hook always runs after the automatic note copying (see
509 "notes.rewrite.<command>" in git-config(1)) has happened, and thus has
510 access to these notes.
511
512 The following command-specific comments apply:
513
514 rebase
515 For the squash and fixup operation, all commits that were squashed
516 are listed as being rewritten to the squashed commit. This means
517 that there will be several lines sharing the same new-object-name.
518
519 The commits are guaranteed to be listed in the order that they were
520 processed by rebase.
521
522 sendemail-validate
523 This hook is invoked by git-send-email(1).
524
525 It takes these command line arguments. They are, 1. the name of the
526 file which holds the contents of the email to be sent. 2. The name of
527 the file which holds the SMTP headers of the email.
528
529 The SMTP headers are passed in the exact same way as they are passed to
530 the user’s Mail Transport Agent (MTA). In effect, the email given to
531 the user’s MTA, is the contents of $2 followed by the contents of $1.
532
533 An example of a few common headers is shown below. Take notice of the
534 capitalization and multi-line tab structure.
535
536 From: Example <from@example.com>
537 To: to@example.com
538 Cc: cc@example.com,
539 A <author@example.com>,
540 One <one@example.com>,
541 two@example.com
542 Subject: PATCH-STRING
543
544 Exiting with a non-zero status causes git send-email to abort before
545 sending any e-mails.
546
547 The following environment variables are set when executing the hook.
548
549 GIT_SENDEMAIL_FILE_COUNTER
550 A 1-based counter incremented by one for every file holding an
551 e-mail to be sent (excluding any FIFOs). This counter does not
552 follow the patch series counter scheme. It will always start at 1
553 and will end at GIT_SENDEMAIL_FILE_TOTAL.
554
555 GIT_SENDEMAIL_FILE_TOTAL
556 The total number of files that will be sent (excluding any FIFOs).
557 This counter does not follow the patch series counter scheme. It
558 will always be equal to the number of files being sent, whether
559 there is a cover letter or not.
560
561 These variables may for instance be used to validate patch series.
562
563 The sample sendemail-validate hook that comes with Git checks that all
564 sent patches (excluding the cover letter) can be applied on top of the
565 upstream repository default branch without conflicts. Some placeholders
566 are left for additional validation steps to be performed after all
567 patches of a given series have been applied.
568
569 fsmonitor-watchman
570 This hook is invoked when the configuration option core.fsmonitor is
571 set to .git/hooks/fsmonitor-watchman or .git/hooks/fsmonitor-watchmanv2
572 depending on the version of the hook to use.
573
574 Version 1 takes two arguments, a version (1) and the time in elapsed
575 nanoseconds since midnight, January 1, 1970.
576
577 Version 2 takes two arguments, a version (2) and a token that is used
578 for identifying changes since the token. For watchman this would be a
579 clock id. This version must output to stdout the new token followed by
580 a NUL before the list of files.
581
582 The hook should output to stdout the list of all files in the working
583 directory that may have changed since the requested time. The logic
584 should be inclusive so that it does not miss any potential changes. The
585 paths should be relative to the root of the working directory and be
586 separated by a single NUL.
587
588 It is OK to include files which have not actually changed. All changes
589 including newly-created and deleted files should be included. When
590 files are renamed, both the old and the new name should be included.
591
592 Git will limit what files it checks for changes as well as which
593 directories are checked for untracked files based on the path names
594 given.
595
596 An optimized way to tell git "all files have changed" is to return the
597 filename /.
598
599 The exit status determines whether git will use the data from the hook
600 to limit its search. On error, it will fall back to verifying all files
601 and folders.
602
603 p4-changelist
604 This hook is invoked by git-p4 submit.
605
606 The p4-changelist hook is executed after the changelist message has
607 been edited by the user. It can be bypassed with the --no-verify
608 option. It takes a single parameter, the name of the file that holds
609 the proposed changelist text. Exiting with a non-zero status causes the
610 command to abort.
611
612 The hook is allowed to edit the changelist file and can be used to
613 normalize the text into some project standard format. It can also be
614 used to refuse the Submit after inspect the message file.
615
616 Run git-p4 submit --help for details.
617
618 p4-prepare-changelist
619 This hook is invoked by git-p4 submit.
620
621 The p4-prepare-changelist hook is executed right after preparing the
622 default changelist message and before the editor is started. It takes
623 one parameter, the name of the file that contains the changelist text.
624 Exiting with a non-zero status from the script will abort the process.
625
626 The purpose of the hook is to edit the message file in place, and it is
627 not suppressed by the --no-verify option. This hook is called even if
628 --prepare-p4-only is set.
629
630 Run git-p4 submit --help for details.
631
632 p4-post-changelist
633 This hook is invoked by git-p4 submit.
634
635 The p4-post-changelist hook is invoked after the submit has
636 successfully occurred in P4. It takes no parameters and is meant
637 primarily for notification and cannot affect the outcome of the git p4
638 submit action.
639
640 Run git-p4 submit --help for details.
641
642 p4-pre-submit
643 This hook is invoked by git-p4 submit. It takes no parameters and
644 nothing from standard input. Exiting with non-zero status from this
645 script prevent git-p4 submit from launching. It can be bypassed with
646 the --no-verify command line option. Run git-p4 submit --help for
647 details.
648
649 post-index-change
650 This hook is invoked when the index is written in read-cache.c
651 do_write_locked_index.
652
653 The first parameter passed to the hook is the indicator for the working
654 directory being updated. "1" meaning working directory was updated or
655 "0" when the working directory was not updated.
656
657 The second parameter passed to the hook is the indicator for whether or
658 not the index was updated and the skip-worktree bit could have changed.
659 "1" meaning skip-worktree bits could have been updated and "0" meaning
660 they were not.
661
662 Only one parameter should be set to "1" when the hook runs. The hook
663 running passing "1", "1" should not be possible.
664
666 git-hook(1)
667
669 Part of the git(1) suite
670
672 1. git-filter-repo
673 https://github.com/newren/git-filter-repo
674
675
676
677Git 2.43.0 11/20/2023 GITHOOKS(5)