How to configure which shell is used for git pre-commit hooks?

已回答

We have a pre-commit file in our repository and I am able to manually commit with git commit -m “commit message”, but when I use the Intellij IDEA git commit dialog, the pre-commit hook cannot be executed because the environment it is running in seems to be different to the one used on my normal command line, which is using zsh.
Where can I configure which shell environment is used for the git command used by Intellij IDEA?

0

IntelliJ inherits the environment variables from the shell instance it was started in. If you run the IDE via GUI, it will inherit the variables from the parent process like file explorer in Windows, display manager in Linux, etc. It is recommended to run the IDE using the terminal instance that contains the necessary environment variables.

https://youtrack.jetbrains.com/articles/SUPPORT-A-1837 

0

请先登录再写评论。