I've reference this: Git submodule head 'reference is not a tree' error
And this: git submodule tracking latest
Possibly my problem is slightly different. (I'm assuming its the same but not doing something right...)
I want my git setup such that if I run:
git clone -b master --recursive /path/to/main/repo.git
the submodules should always be cloned against "master"
Otherwise, in many cases the referenced commit doesn't exist (The branch of the submodule) or are "out of date" causing the clone to fail with error:
fatal: reference is not a tree
I've tried to setup the main repository to take the submodule master:
git submodule add -b master /path/to/submodule.git
But when cloning the main repo:
git clone -b master --recursive /path/to/main/repo.git
The submodule commit referenced doesn't exist (not taking master as expected)