bypass pre-commit hook for merge commits

后端 未结 2 1316
故里飘歌
故里飘歌 2021-02-07 02:29

I setup some git hooks to run some gulp commands on pre-commit. I basically run jshint/plato. I basically want to bypass these for two c

2条回答
  •  长发绾君心
    2021-02-07 02:37

    So I just found a command that I think i can use to detect the "merge_head"

     git rev-parse -q --verify MERGE_HEAD
    

    If rev-parse returns a hash that means we are currently in a merge state. I can use that to bypass this logic. But will wait for some better advice from more experienced individuals.

提交回复
热议问题