I recently stumbled over problems, while trying to merge two
repositories (RepA and RepB) into a single one (RepM).
I must mention that indexed files in RepA are totally distinct from
indexed files in RepB, thus no conflict shall appear.
The problem is that I never manage to get the exact result I'm hoping for:

1] RepM should have the entire commit histories of both RepA and RepB.
2] In RepM, indexed files should be separated in two directories:  DirA
(for files associated to RepA), and DirB (for files associated to RepB).
3] I should be able to bissect easily within the history of RepM, even
for old commits. It implies that if I checkout a particular commit
(initially associated to RepA), indexed files initially associated to
RepA and RepB should get updated (and not only files associed to RepA).
It implies "interweaving" their histories, so that I can get a "state"
of both RepA and RepB around a same time period of time.

For my scenario, I used these kinds of commands (from a git bash
launched within an initialized repository RepM):

git remote add RepA /path/RepA
git fetch RepA
git checkout -b RepA/master
git merge -s recursive -Xsubtree=DirA RepA/master

git remote add RepB /path/RepB
git fetch RepB
git checkout -b RepB/master
git merge -s recursive -Xsubtree=DirB RepB/master

With these commands, only my first point 1] is satisfied (I can see the
full history associated to RepA and RepB).

If I checkout RepM to an old commit, the files indexed by RepA or RepB
are updated by ignoring the directories DirA and DirB (point 2] is not

Moreover, only files associated to either RepA or RepB (depending on the
origin of the commit) get updated (point 3] is not satisfied).
In history, commits from RepA are all appearing at the beginning, and
commits from RepB are appearing at the end (they are clearly being
Should "rebase" help me to solve this? With what kind of parameters?


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to