Search code examples
gitgitlabgit-post-receive

Git Hook post-receive not executing


--Git hook newbie --

Post-receive not executing when pushed to a git hosted in git lab.

The git repo in our live server is a clone of the gitlab repo.

Why does when i push to the gitlab repo, the git in the live server does not execute the post-receive in the hooks.

Do i need something to set up in the gitlab?

The post-receive is in the live server .git/hooks/post-receive but not on the local and is not pushed in the gitlab repo


Solution

  • As the official guide indicates, you do not have to install hooks in .git/hooks/post-receive, but in /home/git/repositories/<group>/<project>.git/custom_hooks/ (if installed by sources) or in /var/opt/gitlab/git-data/repositories/<group>/<project>.git/custom_hooks/ if installed by Omnibus