How create right git hook in PhpStorm on PHP?
If add git hook to pre-commit with following code then you get error “Error!” in PHPStorm.
#!/usr/bin/sh echo "Error!" exit 1
But if implement this on PHP you cannot get this error message in PHPStorm.
- How to push tags to remote git repository with PHPStorm?
- PhpStorm Deployment - Map branch to remote folder
- PhpStorm - How to pull many GIT repositories in one project
- PhpStorm + GIT on virtual machine
- PhpStorm - advanced settings for diff viewer
- Phpstorm git attempts to commit workspace.xml
#!/usr/bin/php <?php echo "Error!"; exit(1);
PHPStorm return not understandable error:
error: cannot spawn .git/hooks/pre-commit: No such file or directory
Any ideas how to resolve this problem?
P.S. In command prompt all is ok.
One Solution collect form web for “How create right git hook in PhpStorm on PHP?”
php.exe is in your
%PATH%, you can ask for the shebang to look for it:
#! /usr/bin/env php.exe