Convert SVA Projects to Git Repositories

The following instructions show you how to convert a project managed by SVA and Subversion to a Git repository. This is a one-way conversion, useful when you are no longer going to be using Subversion for your project.

You can convert your entire Subversion repository, one project at a time, using the provided script.

Using a Local Subversion Repository

Although you don't have to, for performance reasons I recommend that you work with a locally accessible Subversion repository.

The easiest way to accomplish this is to dump the remote repository, and then load it locally. If you're not familiar with that process, you might want to review these notes.

Importing an SVA Project

Before you can begin, you will need to have a working installation of Git that includes the git-svn tool. You should probably install Git using a package manager since the git-svn tool requires that you have all the Perl modules for the Subversion bindings installed.

Once you have git-svn installed, download a copy of this script. The sva2git.sh script will import your project from the Subversion repository and then do some cleanup to preserve your experimental branches and release tags.

To convert a foo project from a Subversion repository repo, do the following:

$ sh sva2git.sh repo foo

This will leave you with a bare Git repository called foo.git. If you want to inspect the converted repository before transferring it somewhere, just clone it:

$ git clone foo.git
$ ls foo

Additional Conversion Options

You can further control the conversion script with the following command line options.

Translating Commit Authors

You should create an authors file before you do the conversion so that you have sane looking commits in your new Git repository.

See the -A option to git-cvsimport for information about how to format the authors file. Use the -A option to sva2git.sh to activate an authors file.

Branches and Tags

Since git-svn can only import one branch path and tag path correctly from Subversion, you won't be able to import all of your branches and tags from your SVA managed Subversion repository.

By default, the sva2git.sh script will convert your experimental branches, and your release tags. If you want to import another set of branches or tags to Git, use the -b and -t options to sva2git.sh.