Git - remote: error: cannot run hooks/post-receive: No such file or directory

前端 未结 1 506
醉酒成梦
醉酒成梦 2021-02-11 15:44

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

相关标签:
1条回答
  • 2021-02-11 16:35

    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).

    0 讨论(0)
提交回复
热议问题