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

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

    If you are using SourceTree you can do this directly from the app. Goto File -> New/Clone then do the following:

    1. Enter the remote SVN URL as the "Source Path / URL".
    2. Enter your credentials when prompted.
    3. Enter the local folder location as the "Destination path".
    4. Give it a name.
    5. In the advanced options select "Git" from the dropdown in "Create local repository of type".
    6. You can optionally specify a revision to clone from.
    7. Hit Clone.

    Open the repo in SourceTree and you'll see your commit messages have been migrated too.

    Now go to Repository -> Repository Settings and add the new remote repo details. Delete the SVN remote if you wish (I did this through the "Edit Config File" option.

    Push the code to the new remote repo when you are ready and code freely.

提交回复
热议问题