After git-svn migration: migrate unmigrated branch later?

96 views Asked by At

We recently migrated from SVN to git. Unfortunately, only the trunk was migrated, but the branches for bugfixes on production revisions were not migrated. 8-{ Is it possible to migrate the missing branches now, months later? Unfortunately, doing the full migration again would be annoying, since we have been working on the repository for a while.

2

There are 2 answers

0
poke On BEST ANSWER

You could still make the full migration again, so you would have two repositories: One with the full Subversion history and all its branches (let’s call it “archive”), and one with the old trunk and development on top of that.

Then you could add the archive repository as a remote to the new one and manually integrate its extra branches into the new one.

It’s possible that some of the commits get duplicated that way but you could either live with that, or rebase those Subversion branches on top of the previously imported trunk commits.

1
Lazy Badger On

Is it possible to migrate the missing branches now, months later?

Yes. Just use (properly!!!) git-svn again:git svn init -b + git svn fetch in order to prepare NEW branches-only partial clone of SVN-repo (or edit in .git/config related [svn-remote] section after init by hand in case of complex tree-structore and|or cloning only some subset of branches), which you later pull|fetch into OLD clone with just trunk and local Git's modification