Let's say my repo structure is currently something like:
ROOT
--LanguageA
----Project A-LangA
----Project B-LangA
----Project C-LangA
--Language B
----Project A-LangB
------SharedFile-1
------SharedFile-2
------SharedFile-3
----Project B-LangB
------SharedFile-1
------SharedFile-2
------SharedFile-3
----Project C-LangB
------SharedFile-1
------SharedFile-2
------SharedFile-3
Currently, if I need to update SharedFile-1
, I need to do so within each Project
directory. Is it possible to use git submodule
or git subtree
to create something like:
ROOT
--LanguageA
----Project A-LangA
----Project B-LangA
----Project C-LangA
--Language B
----Project A-LangB
------SharedFile-1 (auto-updating clone)
------SharedFile-2 (auto-updating clone)
------SharedFile-3 (auto-updating clone)
----Project B-LangB
------SharedFile-1 (auto-updating clone)
------SharedFile-2 (auto-updating clone)
------SharedFile-3 (auto-updating clone)
----Project C-LangB
------SharedFile-1 (auto-updating clone)
------SharedFile-2 (auto-updating clone)
------SharedFile-3 (auto-updating clone)
----Language B Shared Files
------SharedFile-1
------SharedFile-2
------SharedFile-3
...such that I only have to make edits to ROOT/Language B/Language B Shared Files/*
and the changes auto-update in each ROOT/Language B/Project *
dir when a user clones the whole repo?
I know I can break it out into a separate repo. But is it possible to have the above structure? I also know I can create an automation script that does this, but I'm trying to use the above structure, to the extent possible.