git-svn branching

11,005

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.

Share:
11,005

Related videos on Youtube

slayerIQ
Author by

slayerIQ

Updated on September 27, 2020

Comments

  • slayerIQ
    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
    slayerIQ almost 14 years
    I only see url = file:///someurlto/svn fetch = trunk:refs/remotes/trunk i dont see branches in that file
  • silk
    silk almost 14 years
    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/*)
  • kakyo
    kakyo over 10 years
    What 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
    Oli C over 9 years
    I 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.