git钩子:有没有克隆钩子? [英] git hooks : is there a clone hook?

查看:136
本文介绍了git钩子:有没有克隆钩子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想在外部数据库中存储一些关于提交的元信息。在克隆或结帐期间,应该引用该数据库,并将元信息复制到克隆的repo中的文件中。数据库是必需的,而不仅仅是使用文件是为了索引和搜索等...

We want to store some meta-information about the commit in an external database. During a clone or a checkout, this database should be referred and we copy the meta information to a file in the repo which is cloned. The database is required rather than just using a file is for the sake of indexing and searches etc ...

我想如果有一个克隆钩子,我们可以触发这个。我在.git / hooks中找不到样本中的克隆钩子。有一个吗?是在post-checkout挂钩的唯一可能性在客户端?

I thought if there is a clone hook, we could trigger this. I couldn't find the clone hooks in the sample in .git/hooks. is there one? is post-checkout hook the only possibility at client side?

推荐答案

好的,一种方法是使用 clone --template 选项。

ok, one way to do this is to use the clone --template option.

指定客户端挂钩的位置作为值存储到 - template 开关。钩子被复制到克隆中,并立即触发后结帐钩!

Specify the location where the client side hooks will be stored as value to the --template switch. The hooks are copied to the clone, and the post-checkout hook is fired immediately!

这篇关于git钩子:有没有克隆钩子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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