pitfalls svn -> git migration

There shouldn't be any problems converting from svn to git regarding losing history. That's the main purpose of revision control software anyway, to keep track of history.

The number one rule is of course: always back up your repositories before converting them and do several test runs until you feel confident enough to do it in a production environment.

A major difference is the way externals in Subversion behave compared to git submodules. See:

  • Why are git submodules incompatible with svn externals?
  • How do I adapt my svn:externals strategy to git submodules?
  • Git submodule tutorial

Also, expect to spend some time on supporting the users. Git is a different beast and some accustomed svn users can find that it is a bit unintuitive to use.

Edit: Git has built in support for importing and working with svn repositories, using git-svn.


Git-SVN import all Subversion history (and some of additional metadata) into Git repo

git svn clone url://path/to/repo -s

-s if you have "standard" repo-layout in Subversion

but some writers recommend to use

git svn init -s http://example.com/svn/my_proj
git svn fetch

Some additional useful reading:

  • 7 steps to migrate a complete mirror of svn in git (with uncovered step "Clean up branches and tags")
  • Ruby tool for importing existing svn projects into git (branches and tags are imported in a meaningful way)

The most problems arise when there are non-standard branches or tags in SVN. This is when someone did not copy the trunk/ folder into tags/ or branches/, but only subfolders of it. These folders appears as "ripped off" revisions without a common ancestor with trunk. But the content self is correct.

Tags:

Svn

Git