Just like many, I am trying to create a post-receive
hook on a server-side remote git. The following is my code:
cd [LIVE SITE DIR] && git pull origin master | wall
I have added the wall
so that it can be broadcasted and I can receive the notice. One thing that I noticed is when I run ./post-receive
, it all works fine.
Broadcast message from root (Tue Oct 8 14:58:13 2013):
Updating 7ebd925..1a25791
Fast-forward
html/header.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
But, when I tried to do a git push
, ./post-receive
seems to be called but I received the following empty broadcast:
Broadcast message from root (Tue Oct 8 14:53:32 2013):
I have tried to include pwd
, ls
command into the post-receive
and everything works fine for both situations. Except for the git pull
that it seems to return an empty output.
Have gone through all the suggestions provided in SO but to no avail :(. Any help or suggestion is much appreciated.
Thanks!