I am afraid that you should ssh to the server and run the hook script manually. git push does not force the server to execute pre and post and post hooks if nothing is added (i.e. when git prints everything updated).
The rest of the answer is about tracking the tracking version after receiving it, so you can change it without sshing to the server.
Add a shell script called do-post-receive to the local repository:
$ ls -ld .git $ echo 'echo "Hello, World!"' >do-post-receive $ git add do-post-receive $ git commit do-post-receive -m 'added do-post-receive'
Replace your hook hooks/post-receive on the server:
#! /bin/sh while read OLDID NEWID BRANCH; do test "$BRANCH" = refs/heads/master && eval "$(git show master:do-post-receive)" done
(Make sure on the chmod 755 hooks/post-receive server chmod 755 hooks/post-receive .)
Configure your changes from the local repository to the server and see how your do-post-receive code runs:
$ git push origin master ... remote: Hello, World! ...
pts Apr 13 '13 at 7:47 2013-04-13 07:47
source share