svn to git conversion: Correct remote ref must start with 'refs/' error

Viewed 6418

(I'm posting this question with the intention of answering it myself as I could not find the answer elsewhere. Hopefully it will help others who run into the same issue and it will help me next time I'm trying to do it.)

The Challenge

I want to convert an SVN repository to a locally hosted gitlab GIT repository and maintain history.

The Setup

Gitlab 8.5, Ubuntu 14.04 LTS, subversion 1.8.8

The Problem

Initial attempts to convert from svn to git using git-svn or svn2git resulted in the following error.

Error

svn-remote.svn: remote ref '//example.com:81/svn/myrepository/trunk:refs/remotes/trunk' must start with 'refs/'

What I've tried

I've followed both guides in the external references below.

External References used

3 Answers

Removing the leading /slash works for me:

This will not work:

git svn clone "http://..." --prefix=svn/ --trunk=/trunk --branches=/branches --tags=/tags  --authors-file "authors-transform.txt" "C:\Temp\GitRepos"

This works:

git svn clone "http://..." --prefix=svn/ --trunk=trunk --branches=branches --tags=tags  --authors-file "authors-transform.txt" "C:\Temp\GitRepos"

What it woked for me was deleting the .git directory and the run the next command :

git svn clone --authors-file=authors.txt --no-metadata http://svn.companie.com/REP/mock/ -s mock
Related