[vtk-developers] [Paraview-developers] CVS->Git Transition Plan

Brad King brad.king at kitware.com
Mon Apr 19 11:44:45 EDT 2010


Stephane PLOIX wrote:
> Brad King wrote:
>> FYI, if anyone has non-trivial topic branches under development based
>> on a clone of one of the older repositories, it is possible to rebase
>> the branch on the new official history.  I can post instructions if
>> anyone needs to do this.
>
> That would be great!

Okay.  The first rule is to be very careful!  We don't want to end up
with any of the old history merged into the new history (which is one
reason we are disallowing merges at first).  The instructions below
are from memory so hopefully I didn't forget a step.

I'll assume you're working with VTK.  Let's say you have a clone
of the old history called OldVTK:

 $ ls -d OldVTK
 OldVTK

Clone the new repository next to it:

 $ git clone git://vtk.org/VTK.git
 $ ls -d VTK
 VTK

Now you can do the rest locally.  Fetch the new history into the
old clone:

 $ cd OldVTK
 OldVTK$ git fetch ../VTK 'master:newvtk'

Identify the commit in the old history on which your work was based.

 OldVTK$ git merge-base origin/cvshead my-old-work-branch
 aa00bb11

Rebase your work on newvtk:

 OldVTK$ git rebase --onto newvtk aa00bb11 my-old-work-branch

Use in place of 'aa00bb11' the actual sha1 reported by merge-base.
The command says "take commits between aa00bb11 and my branch and
replay the changes as if I had made them starting at newvtk".

There may be some conflicts which you'll have to resolve.  Read
the 'git help rebase' man page for details on this process.  If
you get in trouble you can always use 'git rebase --abort' to
get back to where you started.

Now fetch the rebased branch into the new clone:

 OldVTK$ cd ../VTK
 VTK$ git fetch ../OldVTK 'my-old-work-branch:my-new-work-branch'

Done!  Now your clone of the new repository has your topic branch
and no objects from the old history.

-Brad



More information about the vtk-developers mailing list