Alex Rivera | Logout

How to rebase one repo to another

Asked 2010-02-11T20:27:14.723
13

Let's say I have two different repositories like so:

Project 1:
Init---A---B---C---HEAD1

Project 2:
Init---D---E---F---G---HEAD2

Is there a way to rebase Project 1 (Init to HEAD) to the Init commit of Project 2 so it looks like this:

Project 1 & 2:
     A---B---C---HEAD1
   /
Init---D---E---F---G---HEAD2

The content of Project 1 & Project 2 are similar. The main difference is that their file structure is slightly different like so:

Project1:

MyProject/
    File1
    File2
    File3

Project2:

MyParentProject/
    MyProject/
        File1
        File2
        File3
    SomeFolder/
    SomeOtherFolder/
    ...etc/

FYI: MyProject is not a submodule of MyParentProject. MyProject and MyParentProject exist in two separate locations as two separate git repositories.

Edit
Report

1 Answer

0

I think you could use git-filter-branch with the --parent-filter option.

answered 2010-02-11T21:07:50.020

Your Answer