Git-svn - import full history

前端 未结 2 868
野趣味
野趣味 2020-12-16 01:51

Problem

By default git svn clone imports history only from branch creation onwards, despite the fact, that history for files is present in

相关标签:
2条回答
  • 2020-12-16 02:16

    By default git svn clone imports history only from branch creation onwards, despite the fact, that history for files is present in svn repository prior branch creation.

    Yes. that is true. git svn will only try to import branches as branches if it is told so. From the manpage of git-svn:

    When cloning an SVN repository, if none of the options for describing the repository layout is used (--trunk, --tags, --branches, --stdlayout), git svn clone will create a git repository with completely linear history, where branches and tags appear as separate directories in the working copy.

    If you pass the URL for one branch to git svn clone (instead of the top-level URL), you'll only get the linear history for that branch. That is probably what you are seeing.

    If you want full history, use the repository layout options mentioned above, and pass the top-level URL. Then git svn will try to create git branches for SVN branches, and will try to give them the right history, going back before their creation.

    Note that this will give you the complete repository with all branches. If you only want some branches, you need to modify your configuration as explained in the manpage:

    It is also possible to fetch a subset of branches or tags by using a comma-separated list of names within braces. For example:

           [svn-remote "huge-project"]
                   url = http://server.org/svn
                   fetch = trunk/src:refs/remotes/trunk
                   branches = branches/{red,green}/src:refs/remotes/branches/*
                   tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
    

    See git-svn(1).

    0 讨论(0)
  • 2020-12-16 02:17

    http://git-scm.com/book/en/Git-and-Other-Systems-Migrating-to-Git describes how to import branches and tags properly.

    0 讨论(0)
提交回复
热议问题