Search code examples
gitsvntortoisesvngit-svnsvn2git

git svn -r <REVSION NUMBER> does not fetches the SVN repo till that revision


I want to migrate a folder in SVN to GIT with full commit history. However, the folder was deleted prior to migration.

In this case, I thought of cloning the revision of the project that still had the folder intact.

For this, I tried

git svn clone -r <REVISION NUMBER> <SVN URL>

No branch/commit history is fetched

Then I tried

git svn clone -s -r <REVISION NUMBER> <SVN URL>

ERROR received: HEAD revision does not exists.


Solution

  • TortoiseSVN saved my life.

    1. Open Repo Browser
    2. On top right corner, click the button labelled HEAD
    3. Select the Revision that still contains the deleted folder
    4. Select "Copy to..." and enter the path there you want the folder to be re-created (probably the same path that is already in the text box)

    Viola! You have the folder back in your HEAD revision with full history intact.