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

前端 未结 30 1688
离开以前
离开以前 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:49

    Cleanly Migrate Your Subversion Repository To a Git Repository. First you have to create a file that maps your Subversion commit author names to Git commiters, say ~/authors.txt:

    jmaddox = Jon Maddox 
    bigpappa = Brian Biggs 
    

    Then you can download the Subversion data into a Git repository:

    mkdir repo && cd repo
    git svn init http://subversion/repo --no-metadata
    git config svn.authorsfile ~/authors.txt
    git svn fetch
    

    If you’re on a Mac, you can get git-svn from MacPorts by installing git-core +svn.

    If your subversion repository is on the same machine as your desired git repository, then you can use this syntax for the init step, otherwise all the same:

    git svn init file:///home/user/repoName --no-metadata
    

提交回复
热议问题