Intellij plugin to enable or disable global Git hooks
Hooks are programs you can place in a hooks directory (specified in core.hooksPath) to trigger actions at certain points in git’s execution. Unfortunately, Intellij can only keep track of local hooks located inside a project. With this plugin, you can enable or disable your global Git hooks directly from the IDE.
The following hooks are available:
- pre-commit
- prepare-commit-msg
- commit-msg
- post-commit
- applypatch-msg
- pre-applypatch
- post-applypatch
- pre-rebase
- post-rewrite
- post-checkout
- post-merge
- pre-push
- pre-auto-gc
Configure the core.hooksPath parameter in global .gitconfig according to the Git documentation.
You can also use the following command:
git config --global core.hooksPath {PATH_TO_HOOKS_FOLDER}
If core.hooksPath is not specified, the plugin will use the following path by default:
~/.git/hooks
Starting from version v0.1.0, a new UI is available within the Show Commit Options settings. Many thanks to @ForNeVeR for convincing the JetBrains team to expose the CommitOptionsDialogExtension.
Thanks to @ForNeVeR for providing the finished CI/CD workflows for the IntelliJ plugin.
-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "GitGlobalHooksLocator" > Install
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
