Prepend the branch name to the commit message.
Useful for workflows where the branch name is an issue number and the commits have to begin with it as well.
Put the commit-msg
file inside your .git/hooks
project repository.
Then, for the following commit, on a branch named ABC-1234
:
git commit -m 'my thoughtful description'
The commit message will become:
ABC-1234 - my thoughtful description
🍻