eculver
eculver

Reputation: 517

What's the best way import only a few branches' history when switching from SVN to Git?

We have a huge SVN repository for which we only care about a few branches' history. Is there a clean way to import the history for just these few branches? Mainly, we're trying to avoid the incredible amount of time it would take to import the entire repository if we're really only going to keep a subset of history when it's all said and done.

Upvotes: 1

Views: 109

Answers (3)

Tobu
Tobu

Reputation: 25426

svn-all-fast-export uses the fast-import format to stream repository contents, and is quite flexible. Run it locally on the machine that hosts the repositories.

svneverever can be useful to check that there aren't any subprojects you missed, since svn can get pretty freeform with branches-as-subtrees.

More tools here.

Upvotes: 1

Cebjyre
Cebjyre

Reputation: 6622

You can use paths when doing your git-svn set up: ie if you there is only one directory within the subversion repository that you want, you could use:

git svn clone http://svn.example.com/project/branches/interesting

rather than:

git svn clone http://svn.example.com/project/

Upvotes: 1

Satya
Satya

Reputation: 4478

svndump | svnfilter

Read the man pages for both.

Upvotes: 1

Related Questions