git hooks如何获取分支名称
本文介绍了git hooks如何获取分支名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
请教下git的hooks两个问题:
- 是否有post-push这个hook呢? 我验证了下,不生效;
- 如何在hooks脚本里获取分支名呢?
非常感谢!
解决方案
git的hooks在其目录下有常用的sample,
applypatch-msg.sample post-receive.sample pre-applypatch.sample pre-push.sample prepare-commit-msg.sample
commit-msg.sample post-update.sample pre-commit.sample pre-rebase.sample update.sample
没有post-push, 你想要的是post-receive吧。
具体参数你看下githooks文档就可以了man githooks
或 https://github.com/git/git/bl...
这篇关于git hooks如何获取分支名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文