All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Gavrilov <angavrilov@gmail.com>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: Dylan Martin <dmartin@sccd.ctc.edu>, git@vger.kernel.org
Subject: Re: Merge two repos with history included? (was Re: How do I..?)
Date: Tue, 23 Dec 2008 10:58:01 +0300	[thread overview]
Message-ID: <200812231058.02141.angavrilov@gmail.com> (raw)
In-Reply-To: <20081223004407.GZ21154@genesis.frugalware.org>

On Tuesday 23 December 2008 03:44:07 Miklos Vajna wrote:
> On Mon, Dec 22, 2008 at 02:04:06PM -0800, Dylan Martin <dmartin@sccd.ctc.edu> wrote:
> > I checked, and my initial SVN to git conversion does contain history.
> > 
> > I'm trying to add an exising repo as a subdir of my main repo with
> > history included.  Can anyone tell me how to do that?
> 
> I would try the following: Let's say you have super.git and foo.git, and
> you want to merge foo.git to the subdirectory 'foo' of super.git. Then
> you can do in foo.git:
> 
> mkdir foo
> mv * foo
> git add foo
> git commit -a
> 
> Then in super.git:
> 
> git pull path/to/foo.git master
> 
> And then git log --follow should work just fine on any merged files as
> well.
> 


If the conversion is one-shot, you can also try rewriting commits like this:

cd foo.git
git filter-branch --commit-filter 'TREE=$1; shift; git commit-tree $(echo -e "040000 tree $TREE\tfoo" | git mktree) "$@"' master

(Maybe there is a simpler way, though)

I used this once to merge together the history of a bunch of interrelated (and now dead) projects.

Alexander

      reply	other threads:[~2008-12-23  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22 22:04 Merge two repos with history included? (was Re: How do I..?) Dylan Martin
2008-12-23  0:44 ` Miklos Vajna
2008-12-23  7:58   ` Alexander Gavrilov [this message]

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=200812231058.02141.angavrilov@gmail.com \
    --to=angavrilov@gmail.com \
    --cc=dmartin@sccd.ctc.edu \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.