开发者

Can I had git hook files to the repository so everybody has them

I have a git hook file

.git/hooks/commit-msg

that I would like everybody on the team to have. Can I add it to the reposity 开发者_开发技巧somehow?


I think you can't directly add the hook to the repository. However you can put the script in the normal tree structure and create a small script to link it to the hooks directory. If you have your commit-msg-hook-script is at the root of your repository, you could create an install_commit_hook.sh, with something like this:

ln -s ../../commit-msg-hook-script .git/hooks/commit-msg
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜