1

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.

mdrichardson
  • 7,141
  • 1
  • 7
  • 21
  • 1
    Are any of your contributors on Windows? Git supports symlinks, but [I don't think that plays nicely with Windows](https://stackoverflow.com/q/5917249/354577). – ChrisGPT was on strike Apr 10 '19 at 17:27
  • Most are, but not all. Needs to be cross-platform. I'm considering using pre-commit hooks to copy the files over and commit them – mdrichardson Apr 10 '19 at 17:43

0 Answers0