Reading Time: 3 minutes

Picking up where Dirk Olmes left off in the post, Migrating a MuleForge project to Github, we now suggest a utility to facilitate the migration: svn2git.

svn2git is a tiny utility for migrating projects from Subversion to Git while keeping the trunk, branches and tags where they should be.

This involves three basic steps:

  1. Getting the svn repository
  2. Creating a Git repository
  3. Pushing the trunk, tags and branches (previously added)

Step 1 is where svn2git is very appropriate.  To use it, you just need to execute the command “svn2git” followed by the url of the svn repository and the utility does the rest. Great, isn’t it?

Step 2 is really easy. You simply go to github.com and, after logging in with a github account, create a repo following the help.github guide.

What Step 3 first requires you to add the directory to the git repository by executing

Next, the only thing left is to push all by executing

In most cases that’s it! The work is done. But we had some trouble while migrating our project. After executing Step 1, we received this error message:

After checking the process in more detail (adding –v to the command) we found the specific place where the mistake appeared:

To solve this, you only need to execute the fetch this way:

Problem solved!

Hope this helps. Good luck.