希望Git发布接收钩子以检测某些文件类型 [英] Want Git post receive hook to detect certain file types
本文介绍了希望Git发布接收钩子以检测某些文件类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的post-receive
钩子在任何时候运行特定脚本
某些类型的文件* .hbm.xml被推送到服务器.
动机:我想在任何时候修订我的数据库架构版本号
NHibernate文件已更改.
I would like my post-receive
hook to run a certain script whenever
files of a certain type, *.hbm.xml are pushed to the server.
Motivation: I want to rev my database schema version number whenever
NHibernate files are changed.
谢谢!
推荐答案
这是我想出的:
for i in `git show --pretty="format:" --name-only HEAD | grep '.*\.hbm\.xml' `; do
# call script here.....
exit
done
这篇关于希望Git发布接收钩子以检测某些文件类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文