Apostol Apostolov

Practical thoughts about software

Partial import from SVN to GitHub

A while ago I wrote about how to import an existing SVN repository to GitHub. The approach I used there describes how to import a folder with its full revision history. That however may not be needed or wanted in a lot of scenarios(for example - the SVN repository being too old).  In that case we could do a partial import – import the changes made in the last year or a couple of months or the last “x” revisions of the SVN.

In that case we must do a couple of things:

  1. We must decide from which revision number on we want to import the history. You could check the revision numbers and dates in the “Show Log” option in TortoiseSVN or a similar one depending on the SVN software you use.  We’ll call the revision number BeginNum.
  2. We must find the latest revision number. We’ll call it EndNum.
  3. We must change the “svn clone” command we used in my previous post adding a “–r “ option:

git svn clone –r BeginNum:EndNum –A <path-to-users.txt> <SVN-path-to-clone>

And that is it! Git will now import all the revisions beginning from revision number BeginNum to revision number EndNum without the ones before BeginNum.



Posted By: Apostol Apostolov

Published at

Originally posted at


No comments posted yet.