I have a functional commit-msg
git hook that takes the string from beginning up to the first underscore from a git branch's name and prepends it to the commit message.
For better understanding: The branch name is JIRA-123_fix_problem
, the commit command goes: git commit -m 'Fix problem'
and through the commit-msg
hook the commit message will automatically be changed into JIRA-123: Fix problem
.
Now we're using Nuxt for our current Vuejs project and this makes use of husky. We want to keep husky in this project. Unfortunately (and, I guess, intentionally), husky works by overwriting the git commit hooks, and thus the file .git/hooks/commit-msg
I use will be overwritten by husky and the original commit-msg
hook does not work any more.
How can I either prevent husky from overwriting the commit-msg
hook or instruct husky to do the same thing?
I can't find any documentation for this problem.