Add only a specific folder to git submodule

Viewed 18

I am currently working in a big project that uses a lot of external libraries that are git repositories themselves and need to be added as git submodules.

The problem is that those libraries are not very specific and might include a lot of subdirectories of which I only need one or a few. Example:

Parent repository

  1. subdirectory 1
  2. subdirectory 2
  3. subdirectory 3
  4. subdirectory 4
  5. subdirectory 5
  6. ... so on

All the subdirectories are quite heavy so I don't want to include them unnecesarily.

I've seen you can clone only a specific subdirectory, but I can't figure out how to apply that to a git submodule add command.

Any and all help is appreciated. Thank you!

0 Answers
Related