Currently, I have a post-receive
hook that contains:
git --work-tree=/served/data/location --git-dir=/this/bare/git/repo checkout -f
That worked great, until I wanted to include a submodule, which it just ignores.
After a bit of reading, I thought I could simply add:
git --work-tree=/served/data/location --git-dir=/this/bare/git/repo submodule update --init --recursive
alas:
git-submodule cannot be used without a working tree
Odd, since I've plainly supplied the same --work-tree
as for the prior checkout, which worked fine.
I'm using git version 2.7.4
on the server, and pushing with git version 2.11.0
.
As far as I can tell, this is the same issue as here, except that talks about something called 'OpenShift' that I've never heard of and am not using, so the answer doesn't really help.