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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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"