简体   繁体   中英

How to make IntelliJ IDEA respect pre-commit-msg hook

I would like to prefill the commit message depending on the branch name I am currently on. I have this working with a pre-commit-msg hook from the command line but when commiting from IDEA there is no effect. The commit msg is prepopulated by the last commit msg (I think?). Is there a way to get this working?

Edit: I just found out that the hook is working when I reword a commit message in IDEA. But that's not what I want.

This is not possible, unfortunately. Commit dialog is shown before any git commit operations are called, that is why to hooks is executed.

Please follow https://youtrack.jetbrains.com/issue/IDEA-114680

Maybe a plugin like this may help you to achieve your goal: https://plugins.jetbrains.com/plugin/9278-pre-commit-hook-plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM