I need to migrate a customer from SVN to Git, so I wanted first to try svn2git on a public SVN repository.
I have found several public repos, e.g., https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco and http://svn.apache.org/repos/asf/spamassassin. There is no problem of doing svn co
, but when I try svn2git, I get the following problem:
D:\Documents\work\svn2git\apache>svn2git http://svn.apache.org/repos/asf/spamassassin
Initialized empty Git repository in D:/Documents/work/svn2git/apache/.git/
Using higher level of URL: http://svn.apache.org/repos/asf/spamassassin => http://svn.apache.org/repos/asf
W: Ignoring error from SVN, path probably does not exist: (160013): Filesystem has no item: REPORT request failed on '/repos/asf/!svn/bc/100': File not found: revision 100, path '/spamassassin'
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories
Checked through r100
Checked through r200
Checked through r300
It ran the whole night, and ended with:
Checked through r22000
Checked through r22100
W: Ignoring error from SVN, path probably does not exist: (175002): RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org)
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories
Checked through r477700
Path 'spamassassin' was probably deleted:
RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org)
Will attempt to follow revisions r477601 .. r477700 committed before the deletion
r477601 .. r477679 OK
Checked through r748600
Path 'spamassassin' was probably deleted:
RA layer request failed: PROPFIND request failed on '/repos/asf': PROPFIND of '/repos/asf': could not connect to server (http://svn.apache.org)
Will attempt to follow revisions r748501 .. r748600 committed before the deletion
Checked through r748700
Checked through r748800
Checked through r748900
Checked through r749000
Checked through r749100
Checked through r749200
Checked through r749300
Checked through r749400
W: Ignoring error from SVN, path probably does not exist: (175002): RA layer request failed: PROPFIND request failed on '/repos/asf/!svn/vcc/default': PROPFIND of '/repos/asf/!svn/vcc/default': could not connect to server (http://svn.apache.org)
W: Do not be alarmed at the above message git-svn is just searching aggressively for old history.
This may take a while on large repositories
Checked through r805700
Path 'spamassassin' was probably deleted:
RA layer request failed: PROPFIND request failed on '/repos/asf/!svn/vcc/default': PROPFIND of '/repos/asf/!svn/vcc/default': could not connect to server (http://svn.apache.org)
Will attempt to follow revisions r805601 .. r805700 committed before the deletion
Checked through r805800
Checked through r805900
Checked through r806000
Checked through r806100
Checked through r806200
Checked through r806300
Checked through r806400
Checked through r806500
Checked through r806600
Checked through r806700
command failed:
git checkout -f master
Why does it happen? Is it a permission problem?
Well, so far everything looks fine. If it fails, you should specify with what message it fails.
But besides that, for a one-time migration
git-svn
(thesvn2git
tool you use is based ongit-svn
) is not the right tool for conversions of repositories or parts of repositories. It is a great tool if you want to use Git as frontend for an existing SVN server, but for one-time conversions you should not usegit-svn
or tools based on it, butsvn2git
which is much more suited for this use-case.There are plenty tools called
svn2git
, the probably best one is the KDE one from https://github.com/svn-all-fast-export/svn2git. I strongly recommend using thatsvn2git
tool. It is the best I know available out there and it is very flexible in what you can do with its rules files. Thesvn2git
that is based ongit-svn
suffers from most of the same drawbacks than purgit-svn
, just working around of some of the issues.You will be easily able to configure
svn2git
s rule file to produce the result you want from your current SVN layout, including any complex histories that might exist and including producing several Git repos out of one SVN repo or combining different SVN repos into one Git repo cleanly in one run if you like.If you are not 100% about the history of your repository,
svneverever
from http://blog.hartwork.org/?p=763 is a great tool to investigate the history of an SVN repository when migrating it to Git.Even though
git-svn
is easier to start with, here are some further reasons why using the KDEsvn2git
instead ofgit-svn
is superior, besides its flexibility:svn2git
(if the correct one is used), this is especially the case for more complex histories with branches and merges and so ongit-svn
the tags contain an extra empty commit which also makes them not part of the branches, so a normalfetch
will not get them until you give--tags
to the command as by default only tags pointing to fetched branches are fetched also. With the proper svn2git tags are where they belongsvn2git
, withgit-svn
you will loose history eventuallysvn2git
you can also split one SVN repository into multiple Git repositories easilysvn2git
than withgit-svn
You see, there are many reasons why
git-svn
is worse and the KDEsvn2git
is superior. :-)