I'm aware of git submodules which dwell each in its own separate directory.
For instance:
a.txt
, b.txt
and directory C
with the file 1.txt
x.txt
, y.txt
and directory C
with the file 2.txt
a.txt
, b.txt
, x.txt
, y.txt
and directory C
with the files 1.txt
, 2.txt
If it is not implemented in git - is there a workaround to achieve this?
As explained in your thread by Ævar Arnfjörð Bjarmason
To answer the thought experiment don't conflate submodules with this, instead suppose that you have two branches A & B, which have:
A
:A.txt
B
:B.txt
How will you create and maintain a third branch C which has the union of the two?
The answer to that question will be the same as with the submodule case, i.e. you'd need to have some third branch that you maintain (e.g. with a push hook?) that would be a merge of the two, and ensure that you don't have path conflicts there.
Then if you wanted to use such a branch as a submodule you'd grab that down like you would any other branch