Webstorm Run git hooks option disappeared

The option to run git hooks when pushing to the repo has disappeared. How do I reenable it? Webstorm version 2020.3.1

 

1
10 comments

Please share the listing of the .git/hooks folder from the repo. The checkbox is shown only when there are executable pre-commit or commit-msg hooks in the folder.

0

What if I use latest version of husky and hook executable is located under `.husky` folder?

1

Same here. And I do have runnable hooks in .git/hooks folder. But the checkbox is still not activated.

ubuntu@DESKTOP-AOBR712:~/code/monorepo-template$ ls .git/hooks
applypatch-msg husky.local.sh post-applypatch post-commit post-rewrite pre-applypatch pre-commit pre-push prepare-commit-msg sendemail-validate
commit-msg husky.sh post-checkout post-merge post-update pre-auto-gc pre-merge-commit pre-rebase push-to-checkout

 

0

Same here, hooks are in .husky folder, no run git hooks checkbox.

Please react to this issue

1

I ran into the same issue. The solution for me was to verify execute permissions on the hook files. When changed, the option you are looking for is enabled.

 

0

edwinvelez hi! could you help please, how to verify permissions? and how to change them. thanks!

0

Aneelia I run Linux on my machine. Assuming you are too, look in your project's `.git/hooks` directory and change permission on the hook file you want to run i.e. `chmod 744 <hook_file_name>`. 744 permissions should match existing `.sample` hook files already in that directory. If you are on Windows, right click the same hook file, then properties, then set execute permissions. Hopefully this will work for your situation.

0

I verified execute permission on hook files and the checkbox is still greyed out/disabled any suggestions?

0

If you use husky, run the following command: 

husky install

I'm using the husky version: 7.x.x

0

Finally I resolved my problem!! And the solution is very simple,just excute this command (if you use husky):

`chmod +x .husky/pre-commit`

remenber,must reopen the project in webstorm,than you will seen the "run git hooks"checkbox in your commit panel.

I found this solution because it apppears some hint when I commit some code, is shows "hint: The '.husky/pre-commit' hook was ignored because it's not set as executable."

0

Please sign in to leave a comment.