Committing a commit hook in git
Commit hooks in git live in the .git/hooks directory. What I would love is be able to commit those hooks so everyone checking out the repo has the hooks automatically. I'm not able to add the files inside .git/hooks to 开发者_Go百科git however. Is this not at all possible?
I do realise there are server side hooks by the way, this is a theoretical quest :)
No, all you can do is have the hooks in the repo if needed and ask the owner of the repo to copy them to the .git/hooks
( or have another script in the repo that will copy the hooks ( or create symlink to them) , change permission etc. when it is run )
精彩评论