How do I migrate an SVN repository with history to a new Git repository?

前端 未结 30 1682
离开以前
离开以前 2020-11-22 02:51

I read the Git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like:

SVN repository in: <

30条回答
  •  -上瘾入骨i
    2020-11-22 03:33

    There is a new solution for smooth migration from Subversion to Git (or for using both simultaneously): SubGit.

    I'm working on this project myself. We use SubGit in our repositories - some of my teammates use Git and some Subversion and so far it works very well.

    To migrate from Subversion to Git with SubGit you need to run:

    $ subgit install svn_repos
    ...
    TRANSLATION SUCCESSFUL 
    

    After that you'll get Git repository in svn_repos/.git and may clone it, or just continue to use Subversion and this new Git repository together: SubGit will make sure that both are always kept in sync.

    In case your Subversion repository contains multiple projects, then multiple Git repositories will be created in svn_repos/git directory. To customize translation before running it do the following:

    $ subgit configure svn_repos
    $ edit svn_repos/conf/subgit.conf (change mapping, add authors mapping, etc)
    $ subgit install svn_repos
    

    With SubGit you may migrate to pure Git (not git-svn) and start using it while still keeping Subversion as long as you need it (for your already configured build tools, for instance).

    Hope this helps!

提交回复
热议问题