Git post commit: skip --amend and rebase

后端 未结 2 1529
执笔经年
执笔经年 2021-02-15 05:41

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.

2条回答
  •  深忆病人
    2021-02-15 06:00

    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).

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

提交回复
热议问题