views:

158

answers:

2
+2  Q: 

git-svn branching

Hello,

I am using git with an svn repository everything is going fine I did all my branching with git so I did not branch on svn but I branched with git and pushed those branches to a separate location. Then I commited changed from the branch when needed.
But now I want to create some branches that actually exist on svn I tried:

$ git svn branch someFeature -m "message" 

,and I got this:

$ git svn branch someFeature -m "message"  
Multiple branch paths defined for Subversion repository. 
You must specify where you want to create the branch with the 
  --destination argument.

How should I specify the destination I cant figure this out and the man page isn't that clear also.

A: 

If I read the git svn man page right:

git svn <command> [options] [arguments]

, you should type:

git svn branch -m "message" someFeature 

instead of:

git svn branch someFeature -m "message"
VonC
$ git svn branch -m "message" someFeatureMultiple branch paths defined for Subversion repository.You must specify where you want to create the branch with the --destination argument.Still the same message.
slayerIQ
+1  A: 

You have multiple directories from svn marked as place for branches. Look into you .git/config file, there would be section like that:

[svn-remote "svn"]
url = file:///someurlto/svn
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
branches = branches2/*:refs/remotes/*

There will me multiple entries for branches.

So, when branching you must point in which directory the branch should be created:

git svn branch someFeature -m "test" --destination branches2

where the last element is one of the directories from branches lines in .git/config.

Updating after comments: if there is no entry for branches in git config, the error is the same, you must then add an entry for one.

silk
I only see url = file:///someurlto/svnfetch = trunk:refs/remotes/trunki dont see branches in that file
slayerIQ
Ahh, then that's the problem. git do not know where to put this branch. Add a similar line there as in my example.(branches = pathinsvnrepo/*:refs/remotes/*)
silk