I haven't tried this (yet) but it looks like a promising solution...

http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/


Since repo B would presumably be empty, you can avoid the second merge 
described in the article
and just push into a repo on github (or locally).

Mark



On Sunday, December 22, 2013 8:51 AM, James E Keenan <jk...@verizon.net> wrote:
 
Is it possible to preserve the commit history of a tree of files as it 
moves out of one repository and into another?

I have two use-cases to consider: one long-term, one short-term.

I.

Long-term:  I am considering trying to move Pod-Html from its current 
location within ext/ in the Perl 5 core distribution to cpan/, i.e., 
have CPAN be upstream.[1]  That really can't be done right away because, 
as the subject line of a META ticket opened by rjbs indicates, "Pod-Html 
is a mess."  It's code is poorly structured.  Its test coverage is 
unsatisfactory.  It has many RTs open.  It would be shameful to put it 
out on CPAN in its current state.  I've made one sustained attempt at a 
cleanup[2]; I'm now considering another.  But once it's out on CPAN and 
its principal repository is presumably on github.com, I would like the 
code to retain as much of its history from the Perl 5 repository as 
possible.

How do we do that?

II.

Short-term:  In order to do a thorough cleanup on Pod-Html, I want to be 
free to poke and prod it to my heart's content.  Among other things, 
that's means constant checking of the test coverage with Devel-Cover. 
My preference would be to do that in a repo other than Perl 5, but if I 
did so I would want my changes to go back into Perl 5's Pod-Html so that 
people could get used to it before we moved it to CPAN.  And I would 
want to preserve the commit history in lib/Pod/Htmlm.pm and the test 
suite throughout that round trip.[3]

How do I do that?

Thank you very much.
Jim Keenan


[1] Personally, I don't think Pod-Html needs to be distributed with core 
at all.  But since I know there will be differences of opinion about 
this and since moving it to upstream CPAN is a prerequisite to 
expulsion, moving it to cpan/ is all we need to discuss for now.

[2] At the DuckDuckGo hackathon in Paoli in June/July 2012, rjbs 
suggested I look at Pod-Html and start cleaning it up so that it could 
eventually go to CPAN.  I spent about six weeks working on it.  I myself 
had not used Pod-Html in more than a decade.  I didn't know anyone who 
did.  So I ran out of motivation.  But since I've recently met one 
person who does use it, I'm considering resuming my efforts.

[3] In my 2012 attempts, I moved the existing codebase into a typical 
CPAN structure, then committed that to a new git repo, losing the 
existing history in the process.  I knew much less about git back then. 
  I discussed that with rjbs and he said we could worry about the commit 
history later.  If I embark on this project again, I'd like to get it 
right from the git-go.

Reply via email to