Permanently Disable Git Hooks
Answered
Is there an option to disable git hooks for good? As far as I can tell, the checkbox in the commit dropdown is checked on each commit. I'd like to disable git hooks once and for all (but only if commited from within intellij).
Thanks!
Please sign in to leave a comment.
> Is there an option to disable git hooks for good?
Yes, by removing the hooks from the repo.
Honestly, the use-case of having hooks that you do not need to run is questionable.
There is the request to save the state of the Run Git Hooks checkbox though https://youtrack.jetbrains.com/issue/IDEA-195294
Dmitriy, here's a reason why one would like to do that:
We have a polyglot monorepo, the gitHooks run linters for JS sub-project in the monorepo.
If I work on a C++ sub-project I don't want to run the gitHooks, because they need ~10-20 seconds to finish, so my commits, which don't get value from the gitHooks, take much longer than they need to. The gitHooks might even fail if there is a change in the JS project that requires a npm install or something, so I have to change to the JS project first and run that. I really don't care while working on a C++ part.
Could you please make this configurable via IDE?
I also would want to have control over what I run on my machine or what not.
Remove it the git hook
Jetbrains just want it set @@ Please serve us developers better, thank you! https://youtrack.jetbrains.com/issue/IDEA-195294/Allow-to-disable-Run-Git-Hooks-by-default#focus=Comments-27-6617044.0-0
I've got a good reason too!
Cause I want to 😇
Use case:
Imagine I fork a repo to experiment with and I first want to get up to speed building something, before I have to worry about the hooks I inherited.
But primarily I'd like this feature cause I think it fits the concept of a checkbox to respect the state I set it in.
This is switching back without my prompt conflicts with good UX.
#IMO
I have no composer and php installed globally and for each commit and push I have to disable git hooks, while other developers have decided to install composer and PHP globally (which is a bad practice, don't offer me to do that, pls).
So, for some applications, I would like to disable git hooks permanently too because it is very annoying.
J Shpartko
For IntelliJ there is an open request for this functionality: https://youtrack.jetbrains.com/issue/IDEA-195294
Unfortunately, it has not been implemented yet. You can vote for it and follow it for updates.
Sorry for the inconvenience.