Today I try Gitlab CE version 7.10.4 on CentOS 7 , the installation quite simple not like I did before on FreeBSD. I test it all function work normal git push and pull work great.

On git server I need extract file from git to my live my server and I placed “post-receive” on “custom_hooks” directory on server. The post-receive did extract file from repo and rsync it to my web server. My web server not in same location with my gitlab.

I create post-receive script and test it using shells and everything work normally. I test it with commit and push from , the push and commit work but the post-receive script seems not working.

After few hours searching I found that I am forgot about file permission, not about the excutable post-receive script but it’s about permission for directory involved with the post-receive script. When I test the post-receive script I am login as “root” that’s why everything work normally , things difference when I did commit and push , the script run as “git” user so there will be problem with permission. So the solution is make sure all file and directory permission involved with the post-receive script is set right, or you can do “su” as “git” and test the script :)