wiki:GitMigration

Version 1 (modified by daxim, 4 years ago) (diff)

--

I roughly followed <http://blog.woobling.org/2009/06/git-svn-abandon.html>. I document my steps so they are reproducable by anyone. The attached result is a best-practices conversion up to r10072.

Instead of SAMV's branch, I installed the most recent git release 1.6.6 which incorporates his last changes to git-svn from December 2009. First, our AUTHORS file:

    adamk = Adam Kennedy <adamk《@》cpan.org>
    amire80 = Amir E. Aharoni - אמיר א. אהרוני <amir.aharoni《@》gmail.com>
    ash = Andrew Shitov <andy《@》shitov.ru>
    azawawi = أحمد محمد زواوي - Ahmad M. Zawawi <ahmad.zawawi《@》gmail.com>
    BlueT = BlueT - Matthew Lien - 練喆明 <bluet《@》cpan.org>
    bricas = Brian Cassidy <bricas《@》cpan.org>
    brunov = Bruno Vecchi <brunov《@》cpan.org>
    ChrisDolan = Chris Dolan <cdolan《@》cpan.org>
    claudio = Claudio Ramirez <padre.claudio《@》apt-get.be>
    CSJewell = Curtis Jewell <csjewell《@》cpan.org>
    code4pay = UNKNOWN <code4pay《@》example.invalid>
    dam = UNKNOWN <dam《@》example.invalid>
    daxim = Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 <daxim《@》cpan.org>
    ddn123456 = Dirk De Nijs <ddn123456《@》gmail.com>
    fayland = Fayland 林 <fayland《@》gmail.com>
    gabrielmad = Gabriel Vieira <gabriel.vieira《@》gmail.com>
    garu = Breno G. de Oliveira <garu《@》cpan.org>
    getty = UNKNOWN <getty《@》example.invalid>
    gyu = György Pásztor <pasztor《@》linux.gyakg.u-szeged.hu>
    hashbangperl = Aaron Trevena <teejay《@》cpan.org>
    hjansen = Heiko Jansen <heiko_jansen《@》web.de>
    holli = UNKNOWN <holli《@》example.invalid>
    ishigaki = Kenichi Ishigaki - 石垣憲一 <ishigaki《@》cpan.org>
    jquelin = Jérôme Quelin <jquelin《@》cpan.org>
    jurre = UNKNOWN <jurre《@》example.invalid>
    kaare = Kaare Rasmussen <kaare《@》cpan.org>
    keedi = Keedi Kim - 김도형 <keedi《@》cpan.org>
    KJETIL = Kjetil Skotheim <kjetil.skotheim《@》usit.uio.no>
    mgrimes = Mark Grimes <mgrimes《@》cpan.org>
    missingthepoint = UNKNOWN <missingthepoint《@》example.invalid>
    mmaslano = Marcela Mašláňová <mmaslano《@》redhat.com>
    MoC = UNKNOWN <MoC《@》example.invalid>
    mohsen = Mohsen Basirat <mbas《@》cpan.org>
    offer.kaye = Offer Kaye <offer.kaye《@》gmail.com>
    PacoLinux = Paco Alguacil <paco.linux《@》gmail.com>
    patspam = Patrick Donelan <pdonelan《@》cpan.org>
    pmurias = Paweł Murias <pawelmurias《@》gmail.com>
    pshangov = Peter Shangov <shangov《@》cpan.org>
    Robert = UNKNOWN <Robert《@》example.invalid>
    ryan52 = Ryan Niebur <rsn《@》cpan.org>
    sblandin = Simone Blandino <simone.blandino《@》gmail.com>
    Sewi = Sebastian Willing <sewi《@》cpan.org>
    sharifulin = Anatoly Sharifulin <sharifulin《@》gmail.com>
    shlomif = Shlomi Fish - שלומי פיש <shlomif《@》iglu.org.il>
    submersible_toaster = Andrew Bramble <bramble《@》cpan.org>
    SvenDowideit = Sven Dowideit <SvenDowideit《@》home.org.au>
    szabgab = Gábor Szabó - גאבור סבו <szabgab《@》gmail.com>
    therek = Cezary Morga <cm《@》therek.net>
    tsee = Steffen Müller <smueller《@》cpan.org>
    waxhead = Peter Lavender <peter.lavender《@》gmail.com>
    zipf = Enrique Nell <perl_nell《@》telefonica.net>

Note the anti-spam measure, please s{《@》}{@} before deploying. There are some UNKNOWN, fill them in if you can. The email address is used as part of the committer identity. Ideally, this is the dependable address you will be always using to identify yourself in the context of GitHub? and Ohloh, other Git repositories etc.

Author identities can still be fixed at any time *before* the repo goes live, so don't worry about needing to clone repeatedly to get this right. <http://stackoverflow.com/questions/392332#392427>

First step was

    git svn clone --prefix=svn/ --stdlayout --authors-file=AUTHORS http://svn.perlide.org/padre

Note the --prefix option, NUFFIN's tools will require this. I do not know the way to safely rename remote SVN branches in an existing git-svn checkout, so I cloned again from scratch. Took me two days.

Second step was

    git svn-abandon-fix-refs

Confirmed with git branch -a and git tags that indeed we got proper git branches and tags now.

I skipped grafting (not necessary because of the modern git-svn version) and rebasing commits to clean up history (there are far too many "oops" commits).

Last step was

    git svn-abandon-cleanup

I did the usual housekeeping to shrink the repo size afterwards, deleted the working copy to save further space and then attached it here.


The next steps to take care of after downloading and unpacking are:

  1. Restore the working copy.
  2. Delete branches that are not needed anymore, see git branch man page.
  3. Split the single repo into several.
    1. For each subdirectory name, make a real deepcopy of the repo directory (copy --pr or equivalent); do not use git clone --no-hardlinks as that screws up the remote branch names.
    2. See the git filter-branch man page, section Examples, about --subdirectory-filter.
  4. Then clean up each newly split out repo: <http://git.or.cz/gitwiki/GitFaq#HowdoIremovealltheoldobjectsafterusingfilter-branch.3F>
  5. Push each to GitHub? with --all and --tags, again see NUFFINs blog near the end.

I can do steps 1 to 4, too, if you tell me what can be deleted in step 2.