禁用单个git命令的钩子 [英] Disable hooks for a single git command
本文介绍了禁用单个git命令的钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
鉴于我需要在钩子脚本中使用git,我希望钩子脚本不触发钩子本身。因此,我想按每个命令跳过钩子。
Given that I need to use git inside my hook scripts, I would prefer my hook scripts to not trigger hooks themselves. So I want to skip hooks on a per-command basis.
即我正在寻找这样的选项:
i.e. I am looking for an option like:
git --no-hooks some-git-command
推荐答案
您可以使用:
git -c core.hooksPath = / dev / null some-git-command
如果您不在Unix上(没有 / dev / null
),我想您可以使用:
If you are not on an Unix (no /dev/null
) I suppose that you can use:
git -c core.hooksPath = some-git -command
这篇关于禁用单个git命令的钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文