Search code examples
svngit-svn

git svn takes forever, svn takes an hour


I have to use svn in a large project. I can checkout the trunk of the project without any problem. It takes between 30min / 1 hour. I do it like this:

    svn checkout https://myrepo.com:port/svn/trunk/

but if I try to use git, it takes forever. I've been doing git svn fetch for like two days after getting errors doing the checkout as I read in some answers to similar questions, but nothing. The command I use is

    git svn clone https://myrepo.com:port/svn/trunk/

The issue (I think) is that git is trying to clone EVERYTHING (all branches) plus other stuff which I don't want. On the directory svn, there is trunk and branches but also other directories which I don't need. I want only the trunk.

Is this the normal behavior?


Solution

  • With your command it only clones trunk, as you specified the trunk URL. But it still clones its whole history by getting all revisions one after the other and then making a Git commit out of it. This needs ages, especially if you don't do it on the server where the SVN repository is on the filesystem. This is one of the many reasons I discourage from using git-svn or git-svn based tools for one-time migrations.

    You might use the --revision parameter to git svn clone to only import a part of the history, e. g. the last 10 commits.