简体   繁体   English

Windows上的Git接收钩子创建捆绑

[英]Git on Windows post-receive hook to create bundle

I have a git repo hosted on an apache 2.2 server running as a local service on a windows 2003 server. 我在apache 2.2服务器上托管了一个git repo,该服务器在Windows 2003服务器上作为本地服务运行。 I'd like to add a git post-receive hook to have a bundle in the dropbox sync directory updated. 我想添加一个git post-receive挂钩,以更新Dropbox同步目录中的捆绑包。 The client pull and push work and I am able to generated the bundle at the windows command line, I am stumbling over how to write and debug the hook's shell script. 客户端的拉动和推送工作,我能够在Windows命令行上生成捆绑包,我在如何编写和调试钩子的Shell脚本方面遇到了麻烦。

As a first stab I created a post-receive file under hooks directory with the contents below, but nothing seems to happen when I push changes to the server 首先,我在hooks目录下创建了一个接收后的文件,内容如下,但是当我将更改推送到服务器时似乎什么也没发生

!/bin/sh !/ bin / sh

git bundle create "C:\\Documents and Settings\\fkhan\\My Documents\\Dropbox\\git_bundles\\cs701.bundle" master --all git bundle创建“ C:\\ Documents and Settings \\ fkhan \\ My Documents \\ Dropbox \\ git_bundles \\ cs701.bundle”母版-全部

When a hook fails are there any logs generated that can be used for debugging? 当挂钩失败时,是否会生成任何可用于调试的日志?

As far as I know, no log file is generated. 据我所知,没有生成日志文件。 You can modify your script to log what you want though. 您可以修改脚本以记录所需的内容。

Also, make sure your script is executable. 另外,请确保您的脚本是可执行的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM