Run PHP with GIT after upgrade

I am using GIT on my server and I am trying to get a PHP file that will execute every time I update my repository. I try to use my hook after upgrade to achieve this.

this is the code i tried:

#!/bin/sh

echo
echo "**** Pulling changes into Prime [Hub 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 not get PHP to execute. Anyone who can illuminate this light?

+3
source share
1 answer

execnever comes back. All you put after the call execis the dead code.

Delete execor put it in front of your line phpif this is the last thing to do. (And after checking for errors, if necessary, obviously.)

So for example

...
git-update-server-info
exec php /path/to/directory/file.php

Or just plain

...
git-update-server-info
php /path/to/directory/file.php

( , php script git.)

+5

All Articles