I've created a pre-commite hook and it works on my local machine, but I don't know how can I share this hook with my collegs
I will be grateful for any help.
Thanks in advance Denis
It’s important to note that client-side hooks are not copied when you clone a repository.
On Server side, the 1st hook is pre-receive.
Not everything is possible in this one, depending on what you want to do before the commit, but that's the place to do stuff if you want to do it for everybody who use the repository.
Note: You have to have access to the git server to do that.
Edit:
For global settings, take a look at https://stackoverflow.com/a/8842663/3445619
But this solution requires a new git init
to be done by everyone.
If you don't have access to the git server or want to apply code ruler/styler, I would recommend to ask your colleague to make a link from .git/hooks/pre-commit
to a versioned file where you can edit your own pre-commit
hook for everyone.
Or simply share your file with them, if it will never change. (But this will have to be done for every newcomers).
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