repoA
submoduleB <-- repoB-upstream
With this setup, submodule update --remote
tracks the latest changes from repoB-upstream. From submoduleB I can commit local changes, and from repoA I can commit changes to submoduleB. Unfortunately, commits in repoA will only store hashes of the changes to submoduleB. Since I don't have commit rights to repoB-upstream, on cloning repoA others will receive:
fatal: reference is not a tree: <hash>
Unable to checkout '<hash>' in submodule path '<submoduleB>'
It would be nice if local commits from submoduleB where stored in repoA...
repoA
submoduleB <-- repoB-fork <-- repoB-upstream
In this setup, I have commit rights to repoB-fork and can push changes from submoduleB. Therefore submodule update --remote
won't throw "unable to checkout" errors. Unfortunately, I now have to manually merge changes from repoB-upstream into repoB-fork.
Is there some way to get the best of both worlds?