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:
- Getting the svn repository
- Creating a Git repository
- 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?
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:
Hope this helps. Good luck.