My website was moved to a new server, ubuntu to centos and git is no longer executing the post-receive hook.
I've tried changing permissions, first adding execution permission and then making it 777.
I've checked mount settings in case it's noexec
(it's not).
I added a line touch testing.php to the hook. The file is not created after a push.
I can manually run the hook with ./post-receive
and it execute successfully, including making the test file. The only issue was error: git checkout-index: unable to read sha1 file of /file..
, but it updated the rest of the files. I fixed this error by deleting the git directory and repushing to the remote.
The problem seems to be git not even attempting to run the hook.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…