gitsvnmigrationgerritsvn2git

SVN to git migration: How to add branches from SVN to migrated git (Gerrit)


I have already migrated a SVN repo to git and added it to a Gerrit project.

My problem is that the SVN repo has multiple branches. How to do I migrate the branches and add them to an existing Gerrit project?

Thanks in advance!


Solution

  • See http://blog.jessitron.com/2013/08/converting-from-svn-to-git.html

    git for-each-ref --format="%(refname:short)" refs/remotes/svn |
       sed 's#svn/##' | grep -v '^tags' |
          while read aBranch; do git branch $aBranch svn/$aBranch || exit 1; done