Search code examples
git-svn

Accessing a mixed branches folder layout using git-svn


I am trying to use git svn to connect to our company repository. We have a slightly non-standard branches directory. How to access this using git svn has been discussed before, however, we seem to have a slight twist in our branch names that seems to keep me from getting them all.

Let's consider an example svn repo:

trunk/
tags/
branches/
    rootbranch/
    tku/subbranch

We have branches at the root level of the branches directory. But we have branches in nested folders, as well. The same goes for the tags dir, but I think that is just a second example of the same problem.

If I use git svn clone file:///tmp/gitsvn/svnrepo git-clone -s, I get only the root branches, as expected:

/tmp/gitsvn/git-clone$ git branch -r
  rootbranch
  tku
  trunk

But if I clone using _git svn clone file:///tmp/gitsvn/svnrepo git-clone2 -b branches//_, I get only the sub-branches:

/tmp/gitsvn/git-clone2$ git branch -r
  tku/subbranch

Is there a way to have both?


Solution

  • For anyone else who stumbles over this: it seems that having both is not possible. Subversion allows a mixed setup of branches, but it is discouraged, and so it seems okay that git does not support this. My solution was to bring all branches to the same level, then forget about the issue and move on. Having only one level of branches seems better anyway.