gitgit-worktree

Why doesn't my post-checkout hook fire when creating a new worktree in a bare repository?


I want to run a post-checkout script whenever I git worktree add <branch> in my bare repository.

So far I've:

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!


Solution

  • 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/