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

问题描述

每次运行 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挂钩拉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 07:04