msysgit error with hooks: “git error: cannot spawn .git/hooks/post-commit: No such file or directory”

Add the SHEBANG to the first line of hook, like so:

#!/bin/sh
echo "executing post-commit"
exit 0

This had me stumped for a while as well and I saw that adding the shebang fixed it. In SVN world, while in *nix we have a “pre-commit” script and in Windows we had “pre-commit.bat” and SVN automatically picked up the bat file in Windows. Git doesn’t seem to pick up a pre-commit.bat ( or any hook ) and adding the shebang to the hook file worked.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)