Does IntelliJ IDEA still support post-commit hooks?
Answered
Searches of the forum seem to suggest that Intellij IDEA once supported post-commit hooks, but I've been unable to set up any in my own environment so far. Is it still possible, and, if so, are there any resources that explain how to do it?
Please sign in to leave a comment.
Hi,
We support all git hooks. As long they are configured properly, they will be run when you commit from IDE.
Can you share some details what are you trying to setup and how idea can help?
Right now, I'd like to be able to run a post-commit hook that only prints a simple output message. I'm not sure I'm able to successfully any hooks, at the moment. I'm not seeing any changes take effect from the prepare-commit-msg file I'd edited, either.
How did you set it up? Is the hook run when you commit from terminal?
If it works via terminal, it will definitely work via ide.
Doesn't run from the terminal.
One example is the commit-msg file (originally commit-msg.sample) that was created by default in the .git folder of my project. All it does it print an output message. I removed the .sample extension and changed the settings on the file to make it executable. When I commit a change, however, I don't see any output, whether committing via command terminal or within IDEA.
In order for it to run via IDE, it must be runnable from the terminal. I do not know how to help further as it seems you have take all the steps. Please see: https://serverfault.com/questions/590828/git-post-commit-post-receive-hook-not-working