Before commit: run git hooks


hi guys

I want to enable "run git hooks" before commit, I know its possible since i enabled it once (in one project, depicted below)

but i cant remember / figure out how to do this in another project

can you please help?





The option appears there when git hooks that can be skipped - pre-commit and commit-msg - are added to the repo.

So you need to create hooks in .git/hooks to make it appear.


Goland runs pre-commit hooks without GO-env variables(and other like node, etc), that properly setted up and normal working in project. So i cannot run go command(or node) written in git hooks. How to fix this?


Goland just calls git, which runs the hooks on its own. It, of course, executes the command with the environment settings available for the IDE process itself. Make sure that the way you start Goland correctly inherits your environment (e.g. running via Toolbox requires Toolbox restart after environment variables changes).

BTW, does running git in the builtin terminal execute the hooks correctly?


Thank you, Dmitriy Smirnov! I will try another way to start Goland.

And yes, running git the builtin terminal executes the hooks correctly.


I have git hooks and see no option. I cant get PhpStorm to run my git hooks. They only run if I use git from the command line.


Please sign in to leave a comment.