本文介绍了如何在Windows平台上编写Git Server Hooks?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法找到Windows的Git钩子的任何清晰示例。我在Windows Server上使用Bonobo Git Server。我需要预提交和提交后的钩子作为cmd或bat。预先提交应该检查空的注释,并且提交后应该发送关于提交的电子邮件通知。可能有人有类似的钩子,并准备分享?
解决方案
经过一些实验后,我发现
#!/ Git / sh
echo这是接收挂钩>> result.txt
in
C:\inetput\wwwroot\Bonobo.Git.Server\App_Data\Repository\< your repository> \hooks\receive-hook
在远程执行
git push
然后你可以调用一个批次像
#!/ Git / sh
cmd // Cpost-receive.cmd
I can't find any clear examples of Git hooks for Windows. I use Bonobo Git Server on Windows Server. I need pre-commit and post-commit hooks as cmd or bat. Pre-commit should check empty comments and post-commit should send an e-mail notification about commit. May be somebody has similar hooks and ready to share?
解决方案After some experimenting I found out that
#!/Git/sh echo This is the receive-hook >> result.txt
in
C:\inetput\wwwroot\Bonobo.Git.Server\App_Data\Repository\<your repository>\hooks\receive-hook
Was executed on a remote
git push
Then you can call a batch like
#!/Git/sh cmd //C "post-receive.cmd"
这篇关于如何在Windows平台上编写Git Server Hooks?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!