How to use git-svn to checkout only trunk and not branches and tags?

后端 未结 3 1691
感情败类
感情败类 2020-12-24 11:18

I\'m working on a Java legacy project which has 20 modules connected to each other. So, each module has it\'s own branch and tag. The structure is like this:



        
3条回答
  •  攒了一身酷
    2020-12-24 11:37

    Edit: I misread the question and answered what I thought you were asking, not what you actually asked.

    To clone just the trunk

    Cloning a single Subversion directory is easy, and it actually doesn't matter which directory you clone. Just don't specify any of the "layout" arguments, and give the path to the trunk directly:

    git svn clone http://path.to.svn.repo/module1/trunk
    

    To clone a specific module, including tags and branches and so forth

    A "normal" git svn clone would look something like the following:

    git svn clone --stdlayout http://path.to.svn.repo/
    

    What you want to use instead will be thus:

    git svn clone --stdlayout http://path.to.svn.repo/module1/
    

    That will find the trunk, branch and tag subfolders of the module1 folder, and clone them for you.

提交回复
热议问题