How can I trigger a post-commit hook with the command git cherry-pick <commit>
?
What I've tried:
- I tried the command
git commit -m '...'
. It triggered the post-commit hook normally. - In the githooks document, there are no hooks related to cherry-pick.
- After viewing the source code of Git, I found it uses
git merge
in some cases, andgit commit
in others. But I'm not sure when to use which command.
My questions are:
- Why don't post-commit hooks work when I use
git cherry-pick
? - Is there a hook that cherry-pick will run?
git cherry-pick
, like thepost-commit
hook, it need to run after the entire commit process is completed. Is there any way to achieve it? – Litterbug