1. The situtation
Let's say I have a repository with the following folder structure:
repo1\
|
|-Foo\
|-Bar\
2. The Requests
- In a second repo repo2
I want to use repo1
as submodule; but only the contents of the folder Foo\
.
- Whenever someone clones repo2
and initializes the submodule, automatically (or only with reasonable effort) there should be only the folder Foo\
present in the submodule folder.
3. What I have tried
- Sparse checkout as indicated here does not work with submodules at all, at least as far as I managed to make it work
- Filter branch as indicated here or here works for me fine; but whenever someone clones repo2
the procedure must be repeated for their clone
4. The Questions
- How can I make that work?
- What else should I try?