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-checkoutwith 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
huskythat was changing the git hooks dir in git config. It was enough to simply commit thepost-checkouthook to the repo under.husky/