OK, I've found a working work-around.

The git-svn documentation reads:

When using multiple --branches or --tags, *git svn* does not automatically 
handle name collisions (for example, if two branches from different paths 
have the same name, or if a branch and a tag have the same name). In these 
cases, use *init* to set up your git repository then, before your first *
fetch*, edit the .git/config file so that the branches and tags are 
associated with different name spaces. For example:

branches = stable/*:refs/remotes/svn/stable/*
branches = debug/*:refs/remotes/svn/debug/*

<endquote>

You can use this to give your branches a prefix so they won't collide with 
trunk. Example:

Given a svn project called "src" that has these branches:

./trunk
./branches/toysrus/1.0.x
./branches/trunk/3.0.x
./branches/dev/tfnico/
./branches/walmart/1.0.x

Like in your repository, aside from trunk there are branches on the second 
level (hence the -b branches/*/* parameter to git svn clone).

Now, first initialize the empty git-svn clone:

> git init src

Now initialize the svn configuration, using init instead of clone:

> git svn init -T trunk -b branches/*/* --ignore-paths dev --no-metadata 
svn://svn-dev/daten/svn/repository/src

Now, before you start the real cloning, configure the .git/config:

Find this line:
   branches = website/branches/*/*:refs/remotes/*/*

and change it to:
    branches = website/branches/*/*:refs/remotes/svn-branches/*/*

Now start cloning:

>git svn fetch


Now the git repo branches should end up like this:

  remotes/svn-branches/dev/tfnico
  remotes/svn-branches/toysrus/1.0.x
  remotes/svn-branches/trunk/3.0.x
  remotes/svn-branches/walmart/1.0.x
  remotes/trunk

Does this work for you?

By the way, I can't get the --ignore-paths option to work. Maybe my local 
git version is too old (using 1.7.1 here).


-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/kCoxm7akjaAJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to