Upstream submodules
When upstream has submodules
A plain clone leaves the submodules of upstream empty. git-nested warns about it.
To nest them too, add --recurse-submodules:
git nested clone --recurse-submodules https://github.com/user/lib ext/lib
Each submodule becomes a nested repository of its own, inside ext/lib.
Each one stays at the commit upstream pins.
Pull
pull keeps them nested. After the pull, each one moves to the commit
upstream pins now.
If upstream adds a new submodule, a plain pull leaves it empty. To nest it too:
git nested pull --recurse-submodules ext/lib
Push
push sends them back to upstream as submodules again. Upstream sees no
difference.
Replace your own submodule
You have a submodule in your repository and want it nested instead:
git nested init --from-submodule ext/lib
This:
removes the submodule, from
.gitmodulesand.git/modulestoo,clones the same URL at the same commit into
ext/lib,makes one commit.
A relative submodule URL is resolved against the origin remote of your
repository.