Answer the question
In order to leave comments, you need to log in
How to make git hooks work?
I'm trying to set up git on the server like here https://habrahabr.ru/post/127213/
I made a Hub bare repository in the /bare folder, in the /home/git/web/site.ru/public_html folder (website folder) - Prime repository, poured the contents of the master branch from the Prime repository into the Hub, cloned the contents of the bare repository into the Denver www folder. Created a post-update file in the /bare/hooks folder with the following content
#!/bin/sh
echo
echo "**** Вытягиваем изменения в Prime [Hub's post-update hook]"
echo
cd /home/git/web/site.ru/public_html || exit
unset GIT_DIR
git pull hub master
exec git update-server-info
Answer the question
In order to leave comments, you need to log in
make sure the hook works, add something like touch /tmp/1.txt at the very beginning, if it works, then log the execution of each command and see what goes wrong and where exactly the problem is.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question