How do I force git to run a post-receive hook on a server even if I don\'t have a new commit to push?
I use git to aut
Post-receive is the wrong place for artificial command responses.
You want your server-side goodies in the pre-receive exit, dependent on the updated ref -- do e.g. git update-ref refs/commands/update-hooks @ on the server, then you can e.g. git push server +@:commands/update-hooks, and in the server's pre-receive you can
while read old new ref; do case $ref in
commands/update-hooks)
maybe check the incoming commit for authorization
update hooks here
echo the results from the update
denypush=1
;;
refs/heads/master)
extreme vetting on master-branch updates here
;;
esac; done
((denypush)) && exit $denypush