git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Merge two repos with history included? (was Re: How do I..?)

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Dec 23, 2008, 00:44 UTC
Message-ID
<20081223004407.GZ21154@genesis.frugalware.org>
In-Reply-To
<e1a4c7f60812221404k57a5e150kac74f53c784b6b4a@mail.gmail.com>
On Mon, Dec 22, 2008 at 02:04:06PM -0800, Dylan Martin <dmartin@sccd.ctc.edu> wrote:
> I tried converting an existing SVN repo to git and then adding it to
> my main git repo using the subtree merge technique described at
> http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html.
>  I now have the various files in my repo, but they have no history.

They have, but you are right about that - due to the nature of subtree merge - git log <path> will show only the merge commits. (However git blame works fine, for example.)

> 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.

Previous: Dylan MartinNext: Alexander Gavrilov
Message 2 of 3 in “Merge two repos with history included? (was Re: How do I..?)”
  1. Dylan MartinDec 22, 2008
  2. Miklos VajnaDec 23, 2008
  3. Alexander GavrilovDec 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.