From: Avery Pennarun <apenwarr@gmail.com>
To: "Kelly F. Hickel" <kfh@mqsoftware.com>
Cc: git@vger.kernel.org
Subject: Re: Best way to merge two repos with same content, different history
Date: Fri, 5 Jun 2009 13:01:00 -0400 [thread overview]
Message-ID: <32541b130906051001k1ea4d960m4fcf7679b5b4f740@mail.gmail.com> (raw)
In-Reply-To: <63BEA5E623E09F4D92233FB12A9F794303117DBF@emailmn.mqsoftware.com>
On Fri, Jun 5, 2009 at 12:30 PM, Kelly F. Hickel <kfh@mqsoftware.com> wrote:
> Stated another way, I have two repositories, "new" and "old",
> where the files in the initial commit on branch "B1" in "new" have
> exactly the same content as the last commit on branch "B1" in "old".
> There also exist various branches in "new" based on "B1". I'd like to
> merge all the commits from "new" into "old", but the SHA1s are
> different, presumably because the history leading up to those points are
> different.
>
> Other than using manually format-patch on every branch in new,
> then applying the patches (presumably with regular old patch, since the
> ancestor commit IDs won't match), is there any "good" way to merge "new"
> into "old"?
The usual replacement for "manually using format-patch" is to use "git
rebase." It does pretty much exactly what you're describing, assuming
you don't do too many complicated merges in the meantime.
Another option is to use the .git/info/grafts file. Here's a brief
intro: http://git.or.cz/gitwiki/GraftPoint
You'd use that to pretend the parent of your top-skimmed branch is
actually the equivalent commit in your new branch. Then could run
"git filter-branch" to make the graft permanent, and get all your
users to switch to the new repository.
Or you could skip the filter-branch stuff and keep the really hold
history somewhere else, available for use if someone installs the
graft in their local repo. This would lead to a smaller repository in
the general case. (I gather that's what the Linux kernel does for
per-2.6.11 versions.)
Have fun,
Avery
next prev parent reply other threads:[~2009-06-05 17:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 16:30 Best way to merge two repos with same content, different history Kelly F. Hickel
2009-06-05 16:53 ` Rostislav Svoboda
2009-06-05 17:10 ` Kelly F. Hickel
2009-06-05 17:19 ` Rostislav Svoboda
2009-06-05 18:46 ` Robin H. Johnson
2009-06-05 19:06 ` Best way to merge two repos with same content, differenthistory Kelly F. Hickel
2009-06-05 20:02 ` Robin H. Johnson
2009-06-05 20:08 ` Kelly F. Hickel
2009-06-19 9:52 ` Michael Haggerty
2009-06-05 17:01 ` Avery Pennarun [this message]
2009-06-05 17:11 ` Best way to merge two repos with same content, different history Kelly F. Hickel
2009-06-05 17:15 ` Markus Heidelberg
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=32541b130906051001k1ea4d960m4fcf7679b5b4f740@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=kfh@mqsoftware.com \
/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).