如何在Windows平台上编写Git Server Hook?

前端之家收集整理的这篇文章主要介绍了如何在Windows平台上编写Git Server Hook?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我找不到任何关于 WindowsGit钩子的明确例子.我在Windows Server上使用Bonobo Git Server.我需要预先提交和后提交挂钩作为cmd或bat.预提交应检查空注释,提交后应发送有关提交的电子邮件通知.可能有人有类似的钩子并准备分享

解决方法

经过一些实验,我发现了这一点

#!/Git/sh

echo This is the receive-hook >> result.txt

C:\inetput\wwwroot\Bonobo.Git.Server\App_Data\Repository\<your repository>\hooks\receive-hook

是在遥控器上执行的

git push

然后你就可以调用批次了

#!/Git/sh

cmd //C "post-receive.cmd"

猜你在找的Windows相关文章