git post commit:跳过--amend并重新设置基准 [英] Git post commit: skip --amend and rebase

查看:88
本文介绍了git post commit:跳过--amend并重新设置基准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个提交后的钩子,它可以将红宝石填满.它工作得很好,但是在某些情况下,当我进行基础调整或提交--amend时,我想跳过代码执行.

I have a post-commit hook that does stuff un ruby. It works very well but in some cases I would like to skip the code execution when I do a rebase or when I do a commit --amend.

有人知道我在这些情况下或如何解决时无法触发提交后钩子吗?

Does someone have an idea how I could not trigger the post-commit hook in these cases or any work around?

格雷格

推荐答案

重新建立基础时,.git文件夹中存在一个名为rebase-merge的目录.这可能是在rebase期间禁用该钩子的一种方法(rebase btw的开始由pre-rebase钩子指示).

When rebasing, there's a directory called rebase-merge present in the .git folder. That could be an approach to disable the hook during a rebase (the start of a rebase btw is indicated by the pre-rebase hook).

但是,关于--amend,我无能为力.

Regarding the --amend however, I can't help you.

这篇关于git post commit:跳过--amend并重新设置基准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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