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 source of the message:
message(a-mor-Foption),template(a-toption orcommit.template),merge(a merge commit),squash(a squash), orcommit(a-c,-C, or--amendoption). - The SHA-1 of the relevant commit. This third argument is passed only when the source is
commit.
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