开发者

How to migrate from SVN to GIT Locally

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,开发者_JAVA百科 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.


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.


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.


"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/


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜