clarkcox3
clarkcox3

Reputation: 589

Can I track an svn repository with multiple branch directories

Currently, I am working with an svn repository with a slightly unconventional layout. There are two directories where branches may appear. For example:

Project/
    Foo/
        A/
        B/
        C/
    Support/
        Branches/
            taskbranch1/
            taskbranch2/
            taskbranch3/
            taskbranch4/
        Tags/

In this layout, there isn't really a designated "trunk". Each of the directories "A", "B", and "C" are branches, in the sense that they represent ongoing development of multiple versions of the same product, and they are the closest thing to a "trunk" for the developers working therein.

Branches/

contains more traditional, task-oriented branches (i.e. they are typically short-lived and are merged back into A, B or C and deleted when the task they represent is completed)

When working in git, I'd like git to treat the children of "Foo" and the children of "Support/Branches" as branches. However, the wildcards allowed in the svn-remote.branches setting don't seem to be expressive enough to allow this.

In the past, I've set up several different git repositories (one each for A, B and C), with the same svn URLs for tags and branches, however, that seems wasteful, as the vast majority of the contents of those three repositories will be identical.

Upvotes: 2

Views: 242

Answers (1)

Arrowmaster
Arrowmaster

Reputation: 9271

When you run git svn clone or git svn init you can use the --branches (and --tags) options more than once to specific multiple locations for branches (and tags).

What this does is create multiple svn-remote.<name>.branches settings in the config. This should work correctly instead of trying to use a single svn-remote.<name>.branches setting that matches both locations.

Upvotes: 2

Related Questions