Prepare-commit-msg
suggest changeThis hook is called after the pre-commit
hook to populate the text editor with a commit message. This is typically used to alter the automatically generated commit messages for squashed or merged commits.
One to three arguments are passed to this hook:
- The name of a temporary file that contains the message.
- The type of commit, either
- message (
-m
or-F
option), - template (
-t
option), - merge (if it’s a merge commit), or
- squash (if it’s squashing other commits).
- The SHA1 hash of the relevant commit. This is only given if
-c
,-C
, or--amend
option was given.
Similar to pre-commit
, exiting with a non-zero status aborts the commit.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents
4 Undoing
5 Staging
6 Git diff
7 Merging
10 Submodules
11 Aliases
12 Rebasing
14 Branching
15 rev-list
16 Squashing
18 Recovering
19 git clean
21 .mailmap
23 Pulling
24 Hooks
26 Stashing
27 Subtrees
28 Renaming
29 Pushing
30 Internals
31 git-tfs
33 git-svn
34 Archive
37 Show
39 Bundles
42 Blaming
44 Worktrees
45 Git remote
47 git patch
52 TortoiseGit
57 Git rerer
59 git tagging
61 diff tree
62 Contributors