This gist provides an example of how to only include parts of others' repository as submodule in your project.
What is more, it will also show how to "put" the folders of submodule to desired location (e.g. under your project's root), without breaking the submodule.
Consider we have a repository
Simulation
- README.md
There is one another repository we want to use, but only the algorithm folder is needed.
Robot
- examples/
- tests/
- algorithms/
- README.md
Additionally, we would like the algorithms folder be put under the root of Simulation, not under the submodule folder Robot.
So the desired goal will be having a repository as this
Simulation
- README.md
- algorithms/ @xxx
Great write-up.
One note, if the submodule you're attempting to checkout has submodules of its own (that you don't want/need), don't include
--recursivein thegit submodule update --initcommand.