I\'ve looked at the githooks manpage but unless I\'m missing something I don\'t see an option for local, post-push git hooks. I\'d like to have one that updates the api doc
I recently came across the same issue. I wanted a hook so that a push from my git submodule would commit the new submodule reference in the 'superproject'.
As Chris mentioned, the best way is to just use a git alias, like this:
$ git config alias.xpush '!git push $1 $2 && update-server.sh'
# (remember the backslash before the ! if your shell requires it)
This adds the following to your .git/config file:
[alias]
xpush = !git push $1 $2 && update-server.sh
And so now, if you type:
$ git xpush
your changes will be pushed, and then update-server.sh will be executed.