Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

As I was going through the process of converting SVN repositories to Git repositories, with the svn2git tool, I frequently ran into problems. This can be attributed to many factors, such as previous VCS migrations (RCS → CVS → SVN → GIT) and questionable branching practices along the way.

The good news is that I was able to work around all errors and successfully migrate over 20 years of history to Git. Here is a list of common errors that I came across.

Failed to write to process: Error writing to process for repository myrepo

This is a generic error. The conversion tool will create Git repositories as well as log files in the format of log-myrepo. You should look inside the log-myrepo file for the real error. Sometimes there will be a detailed crash report generated in the Git repo directory in the form of a fast_import_crash_XXXX file.

fatal: Empty path component found in input

This error occurs when there are rules that don't end with forward slashes. You can search for the pattern "^match.*[^/]$" to find the culprits.

svn-all-fast-export is taking a long time to convert my repositories

This can be the case when there are multiple rule files, and the tool is being used once for each rule file. If the svn repositories all reside on one svn server, the rule files should be concatenated into one file to improve speed. This works because the tools only has to do one sweep of the revisions instead of one sweep per rule file.

fatal: Branch name doesn't conform to GIT standards: refs/heads/version2-dev\

It is obvious that there shouldn't be a backslash on the end of that string. This is most likely there because the rule file had CRLF characters. In my case, I had mixed endlines throughout the file. They should be converted to Unix format - (\n) only. Also, this could happen if someone accidentally created a branch with a \ character on the end.

fatal: Branch name doesn't conform to GIT standards: refs/heads/Feature Branch

There cannot be spaces in the branch name. The solution is to write rules for cases like this to rename the branch to something without spaces.

"tag-1.15" in repository "hub" is branching from branch "tag-1-15" but the latter doesn't exist. Can't continue.

A branch may not exist if you are trying to resume conversion from a certain revision. There are many forks of svn-all-fast-export and some do not have the ability to add on new revisions on top of what was already converted. Depending on your actual tool, you will have to rerun the conversion from the beginning each time.