git-svn branching
You have multiple (or no) 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 be multiple entries for branches. (Alternately, if you don't have any branch entries, the first line should work with a standard SVN repo layout.)
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.
Related videos on Youtube
slayerIQ
Updated on September 27, 2020Comments
-
slayerIQ over 3 years
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 changes 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 can't figure this out and the man page isn't that clear also.
-
slayerIQ almost 14 yearsI only see url = file:///someurlto/svn fetch = trunk:refs/remotes/trunk i dont see branches in that file
-
silk almost 14 yearsAhh, 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/*)
-
kakyo over 10 yearsWhat about a plain svn repo without the trunk/branches folder structure? The initial branching part passed. But git svn dcommit fails. It complains that folders don't exist...
-
Oli C over 9 yearsI also had this issue- The solution for me was to clone the entire repo including tags, as if you only clone the trunk, then you can dcommit etc, but cannot push to the correct location.