windows - 如何在Windows平台上编写Git Server Hooks?

标签 windows git hook server bonobo

我找不到任何适用于 Windows 的 Git Hook 的明确示例。我在 Windows 服务器上使用 Bonobo Git 服务器。我需要预提交和后提交 Hook 作为 cmd 或 bat。提交前应检查空注释,提交后应发送有关提交的电子邮件通知。可能有人有类似的钩子(Hook)并准备分享?

最佳答案

经过一些实验我发现

#!/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 - 如何在Windows平台上编写Git Server Hooks?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29512578/

相关文章:

c++ - 在 C++ 中复制文件的一部分

c++ - 使用 mingw64 c++ "declaration of ' __RPC__range' 无类型编译 imapi2 应用程序时 imapi2.h 中的错误”

git - 何时创建新存储库?

keyboard - 如何让 python 检测键盘上的击键并根据 Windows 中的输入键发送不同的字符串

c++ - 在 bmp 文件中保存屏幕截图的设备上下文

c++ - WinAPI:如何确定网络何时正在识别?

git - 为什么 `git push -f` 强制推送所有跟踪分支?

git 无法连接到github

drupal hook_menu_alter() 用于添加标签

bash - Hook bash 中的所有命令输出