如何通过文件系统使用存储库在Windows上运行git钩子脚本? [英] How to run git hook script on windows, using repository through filesystem?

查看:446
本文介绍了如何通过文件系统使用存储库在Windows上运行git钩子脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于它的简单性,我们使用放置在共享磁盘上的远程存储库,使用文件系统路径(\server\share)访问它。在这种情况下,可以运行远程存储库中定义的钩子脚本吗?我已经定义了一个,但它似乎没有启动(在钩子脚本中使用非有效编辑进行测试,女巫应该会导致错误)。

每个Git仓库都有一个 .git / hooks 文件夹,每个钩子都可以绑定一个脚本。
根据需要很容易更改或更新这些脚本。 Git在发生特定事件时执行这些脚本。



您是否将您正在测试的事件绑定到该git repo中的钩子?



检查一下git在Windows中如何执行钩子:



使用钩子的提示:





更多的git hooks阅读:


Because of its simplicity, we use remote repository placed on shared disk, accessing it using file system path (\server\share). Is is possible, in such case, to run hook scripts defined in remote repository? I have defined one but it seems like it is not launched (tested using non valid edit in hook script, witch should cause an error).

解决方案

Every Git repository has a .git/hooks folder with a script for each hook you can bind to. It is easy to change or update these scripts as necessary. Git executes those scripts when specific events occur.

Do you have the event you are testing bind to a hook in that git repo?

Check also this on how git executes hooks in Windows:

Tips for using hooks:

Some more git hooks reading:

这篇关于如何通过文件系统使用存储库在Windows上运行git钩子脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆