I want to run a post-checkout
script whenever I git worktree add <branch>
in my bare repository.
So far I've:
cd
'd into it.hooks/post-checkout
with a simple echo foo
chmod +x hooks/post-checkout
git worktree add master
However, the post-checkout
hook isn't run... or at least my echo
isn't visible.
Is there something I'm missing or misunderstanding?
Appreciate any help!
In this case, it was husky
that was changing the git hooks dir in git config. It was enough to simply commit the post-checkout
hook to the repo under .husky/