I am using GIT on my server and I am trying to get a PHP file to be executed each time I update my repository. I’m trying to use my post-update hook to achieve this.
this is the code I tried:
#!/bin/sh
echo
echo "**** Pulling changes into Prime [Hub's post-update hook]"
echo
cd $HOME/www || exit
unset GIT_DIR
git pull hub master
exec git-update-server-info
php /path/to/directory/file.php
I can’t seem to get the PHP to execute. Anyone able to shine any light on this?
execnever returns. Anything you put after theexeccall is dead code.Remove the
exec, or place it before yourphpline if that’s the last thing that needs to be done. (And after doing error checking if necessary obviously.)So for instance
Or just simply
(or move the statements around if your php script can be called before the git command.)