Home > front end >  Clone a subdirectory of a submodule in git
Clone a subdirectory of a submodule in git

Time:08-28

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?

CodePudding user response:

Unfortunately not!

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

  • Related