1

Our development team is currently using SVN to manage our web application development. The developer managing the SVN server is trying to migrate it from an older Win XP server to another server, but trying to output a dump of the repository fails (corruption or something). Why it is failing is a separate question altogether.

The dev managing the SVN repo suggested exporting the current HEAD of the old repo to use as the base of the new SVN repo, but we will lose all our SVN history. I use git-svn locally which means I have 1.5 years of commit information stored locally. Is there a way to get these commits out of git-svn and put them in a new SVN repo?

James
  • 111
  • 3

1 Answers1

0

If you create a new, empty SVN repo, can you push all the commits from git-svn directly into the repo? (haven't used git or git-svn, but this is what I'd do with one of my hg repos if I needed to get it into an svn repo)

Edit: I managed to get this to work with manual rebasing via mercurial. The only thing that seems special is the manual rebase instead of the automatic svn rebase. You might try that in git-svn before pulling mercurial into the mix.

  1. Create new SVN Repo: svnadmin create targetSVN
  2. Do initial commit on new SVN repo:

    svn co file://targetSVN svnCopy cd svnCopy
    touch test
    svn add test; svn commit -m "Initial Import"

  3. Check the repo out via hg: hg clone file://targetSVN hgCopy; cd hgCopy
  4. Pull in changes from git (via hg-git): hg pull git://yourrepo.git
  5. Manual rebase: hg rebase -s tip -d 0 (0 should be the inital SVN commit, and tip should be the head of the stuff you pulled from git. Make sure the git changesets are linear (have no merges!). Substitute tip for the actual changeset number of the git head (found via hg heads) if necessary). Accept all remote changes when it asks about conflicts.
  6. hg push until all changes are in the svn repo. It pushes 1 changeset at a time.
Darth Android
  • 38,658