I want to run a post-checkout
script whenever I git worktree add <branch>
in my bare repository.
So far I've:
- bare cloned the git repo and
cd
'd into it. - created
hooks/post-checkout
with a simpleecho foo
- set
chmod +x hooks/post-checkout
- run
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 thepost-checkout
hook to the repo under.husky/