Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write Git Server Hooks on Windows platform?

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?

like image 259
JMLabs Avatar asked Oct 19 '22 14:10

JMLabs


1 Answers

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"
like image 90
Marijn Deé Avatar answered Nov 01 '22 16:11

Marijn Deé