git clone --recursive <repo-url>
git submodule update --init --recursive

Submodules vs Keeping it in the same repository

  1. Each submodule has its own separate history
  2. Can be reused across different projects
  3. Different access control
  • Use one repository when it’s really one product
  • Use submodules when it’s truly a separate project that just happens to be embedded or depended on