From: THILLOSEN Andreas <thillosen@free.fr>
To: git@vger.kernel.org
Subject: Git: Having trouble merging two repositories by interweaving their histories
Date: Mon, 09 Sep 2013 23:26:42 +0200 [thread overview]
Message-ID: <522E3D12.4090004@free.fr> (raw)
Hi,
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
satisfied).
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
separated).
Should "rebase" help me to solve this? With what kind of parameters?
Greetings,
Andreas THILLOSEN.
next reply other threads:[~2013-09-09 21:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 21:26 THILLOSEN Andreas [this message]
2013-09-09 23:06 ` Git: Having trouble merging two repositories by interweaving their histories Andreas Schwab
2013-09-10 0:19 ` THILLOSEN Andreas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=522E3D12.4090004@free.fr \
--to=thillosen@free.fr \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).