We use custom-written Git hooks in our project.
Hooks are stored in a project's repository, and, when they do change, to get a new version each user must copy them manually in his .git/hooks directory. This is rather inconvenient.
One way to improve this is to make .git/hooks a symlink into worktree. But this would imply that each branch (even user's local feature branches under development) should have the most current version of hooks. This is not convenient as well.
How would you solve the problem?
Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git's internal behavior and trigger customizable actions at key points in the development life cycle.
The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that's .git/hooks .
It will work, but it will not be managed along with the repository.
Maintain a separate repository of your hooks and symlink into that.
I agree, it'd be nice if Git had a built-in mechanism for propagating hooks scripts but it doesn't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With