Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I import svn branches rooted in different directories into git using git-svn?

Tags:

git

svn

git-svn

I have an SVN repository structure like below. We are using multiple levels under branches for various release maintenance branches, plus a directory for feature branches.

git-svn init seems to work with a single --branches argument, i.e. it seems to expect all of the branches to be in a single location.

trunk
branches
  1.1
    1.2.1
    1.2.2
  1.2
    1.2.1
    1.2.2
    1.2.3
  features
    feature1
    feature2

Any ideas on how to handle this?

Thanks

like image 728
CaptainPicard Avatar asked Nov 03 '08 13:11

CaptainPicard


1 Answers

In your config file, set the svn-remotes section to something like:

[svn-remote "svn"]
    url = svn://svnserver/repo
    fetch = trunk:refs/remotes/trunk
    branches = branches/*/*:refs/remotes/*
    tags = tags/*:refs/remotes/tags/*

This should let you grab the nested branches.

like image 133
Greg Avatar answered Sep 21 '22 15:09

Greg