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

前端 未结 30 1649
离开以前
离开以前 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条回答
  •  不知归路
    2020-11-22 03:36

    I just wanted to add my contribution to the Git community. I wrote a simple bash script which automates the full import. Unlike other migration tools, this tool relies on native git instead of jGit. This tool also supports repositories with a large revision history and or large blobs. It's available via github:

    https://github.com/onepremise/SGMS

    This script will convert projects stored in SVN with the following format:

    /trunk
      /Project1
      /Project2
    /branches
         /Project1
         /Project2
    /tags
     /Project1
     /Project2
    

    This scheme is also popular and supported as well:

    /Project1
         /trunk
         /branches
         /tags
    /Project2
         /trunk
         /branches
         /tags
    

    Each project will get synchronized over by project name:

    Ex: ./migration https://svnurl.com/basepath project1
    

    If you wish to convert the full repo over, use the following syntax:

    Ex: ./migration https://svnurl.com/basepath .
    

提交回复
热议问题