I get the error :
remote: error: cannot run hooks/post-receive: No such file or directory
When trying to push to remote. The post-receivce file
This would happen if the hooks/post-receive
file exists, is marked executable, but cannot be executed. It cannot be executed, because the interpreter, /bin/bash2
, either does not exist or is not executable.
Replace the /bin/bash2
with name of bash that does exist and is executable on the server.
(The reason the error looks like this is, that the operating system only returns the error status, "No such file or directory", but does not report which file does not exist. And the code that tried to execute it does not know that the system already read hooks/post-receive
and was looking for /bin/bash2
. All it knows is it tried to run hooks/post-receive
, so that's what it prints).