I recently ran into the same problem. I need a hook so that a push from my git submodule captures the new submodule link in the "superproject".
As Chris said, the best way is to simply use the git alias, for example:
$ git config alias.xpush '!git push $1 $2 && update-server.sh'
This adds the following to your .git / config file:
[alias] xpush = !git push $1 $2 && update-server.sh
So, if you type:
$ git xpush
your changes will be rolled over, and then update-server.sh will be executed.
ndbroadbent Aug 12 '10 at 10:09 2010-08-12 10:09
source share