Disable hooks for a single git command

流过昼夜 提交于 2019-12-10 23:08:04

问题


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


回答1:


You can use:

git -c core.hooksPath=/dev/null some-git-command

If you are not on an Unix (no /dev/null) I suppose that you can use:

git -c core.hooksPath= some-git-command



来源:https://stackoverflow.com/questions/58337861/disable-hooks-for-a-single-git-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!