On 06/28/12 12:57, Nicolas Bock wrote:
> I checked out the most recent version from CVS and made that the
> initial commit of our git repository. This unfortunately meant
> that we lost all history prior to the switch.
> We would now like to add that missing history into git. I
> converted the CVS to git and have two git repositories now, one
> that is the converted CVS, and one that contains all changes
> since then. How do I merge the two?

>From my understanding, this can be done as follows:

  bash$ INITIAL=/path/to/git/repo/forcvs/snapshot/
  bash$ CVS_FULL=/path/to/git/repo/for/full/cvs/history/
  bash$ cd $INITIAL
  bash$ git branch > all_branches_to_deal_with.txt
  bash$ git remote add cvs_full file://$CVS_FULL
  bash$ git pull cvs_full

at this point you now have two disjoint histories in the same
$INITIAL repository.  Then for each of the branches you have in the
$INITIAL repo (noted in all_branches_to_deal_with.txt), rebase that
branch onto the master branch of the $CVS_FULL repo

  bash$ for branchname in master some_dev_branch some_other_branch;
do git checkout $branchname; git rebase remotes/cvs_full/master ; done

whom you share the repo.  But that's what you're asking for:  the
ability to change history and introduce edits before the initial
(snapshot) checkin.  Read "git help rebase" carefully about what this.

At least, it worked and did what you asked in test repos here.  The
only thing I noticed is that, if there was modern history of
branches that were then merged back in, that branching/merging was
squashed in the resulting history.  As always, clone off copies of
both archives and work from those for testing/exploring.


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to