Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git-svn branching

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.

like image 785
slayerIQ Avatar asked Jun 04 '10 12:06

slayerIQ


People also ask

Does SVN support branching?

Subversion Branching StrategiesSubversion branches (SVN branches) allow your team to work on multiple versions of your code simultaneously. Developers can test out new features without impacting the rest of development with errors and bugs. SVN's “branch” directory runs parallel to the “trunk” directory.

What is SVN and Git and in Git why we use branches?

SVN has a Centralized Model. In git every user has their own copy of code on their local like their own branch. In SVN there is central repository has working copy that also make changes and committed in central repository. In git we do not required any Network to perform git operation.

Can you use Git and SVN together?

git-svn is a specialized tool for Git users to interact with Git repositories. It works by providing a Git frontend to an SVN backend. With git-svn, you use Git commands on the local repository, so it's just like using normal Git. However, behind the scenes, the relevant SVN commands are sent to the server.


1 Answers

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.

like image 136
silk Avatar answered Sep 23 '22 19:09

silk