Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
278 views
in Technique[技术] by (71.8m points)

ubuntu - Git not executing post-receive hook

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ended up fixing this by upgrading from git version 1.7.1 to 2.11


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...