tags:

views:

130

answers:

4

I'm working on a project that initially used Subversion, but the remote repository was removed and i don't want to use Subversion any more. I want to migrate it to git.

There's a way to do it without the remote repository, keeping all revisions history (without doing a git init .)?

I've already made a subversion to git migration with git-svn with no problems it on other projects, but they were on remote repository and i cannot find any info about migrating it locally.

+5  A: 

Subversion is not like Git, it does not keep the repository in your working folder, so you are going to be unable to migrate it.

You will need to create a new repository and check it in as if it was new code.

RedFilter
+1  A: 

There's a way to do it without the remote repository, keeping all revisions history (without doing a git init .)?

Short answer: no.

Unlike git, subversion is a centralized version control system, meaning it stores all revisions history in the server.

In contrast, distributed version control systems like git, mercurial, or bazaar store all revisions history locally. In the latter case, you can indeed import/export between repositories with relative ease. In the former, you need the server's presence to do so.

Santa
A: 

"svn switch --relocate" to the rescue [1].

Firstly you'd have to set up a temporary svn repository in any ordinary server and then relocate your 'local' svn repository (aka working copy) to that server, commit it to there, then use git-svn live you've done before.


[1] http://webkit.org/blog/97/svn-repository-location-change/

Leandro N. Camargo
This doesn't retain all revisions as they were kept on the *original* server. This commit will only have latest one which. So git-svn will only download one revision.
Marcin Gil
A: 

You can only keep the information from the subversion history if you manage to get your hands onto a proper backup of the remote subversion repository that was removed.

Otherwise, the history is lost, and you will just have to start from scratch.

If you do have a backup (such as an rsync copy of the SVN repo files on the server), you can locally do a conversion using git svn by pointing it to the local SVN repo copy via a file:// URL, without doing a special SVN server setup first.

ndim