问题描述
每次运行 git pull
时,我需要在项目上执行一些操作(准备gettext * .mo消息文件)。有什么合适的git钩子,我可以用这个目的吗?
也就是说,是后合并挂钩,所有拉都包含一个合并,但并非所有合并都是拉。它在合并之后运行,并且不会影响结果。如果发生冲突,它永远不会被执行。你必须使用post-commit钩子来挑选它,或者手动调用它。
I need to perform some actions (prepare gettext *.mo message files) on my project everytime I run git pull
. Is there any suitable git hook, which I could use for this purpose please?
The githooks
man page is a complete list of hooks. If it's not on there, it doesn't exist.
That said, there is a post-merge hook, and all pulls include a merge, though not all merges are pulls. It's run after merges, and can't affect the outcome. It never gets executed if there were conflicts; you'd have to pick that up with the post-commit hook if it really matters, or invoke it manually.
这篇关于有没有任何git挂钩拉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!