1

I wish to create a submodule in my repository, and inside that submodule I only want to clone ONE folder to use as a dependency.

For example if this is my current state:

main repository
│__README.md
│__file001.txt
dependency repository
|__src
|__include

I want to have:

main repository
│__README.md
│__file001.txt
|__dependency repository (submodule)
   |__include

How is it possible to do it in git?

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
amit zohar
  • 13
  • 4
  • See https://stackoverflow.com/a/70833606/7976758 – phd Aug 25 '22 at 14:04
  • Another solution to try is sparse checkout: https://stackoverflow.com/search?q=%5Bgit-submodules%5D+sparse+checkout – phd Aug 25 '22 at 14:06

1 Answers1

1

Unfortunately not!

The submodule is a whole repository, so you have to clone it enterely.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74