Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Branching and merging in Subclipse

Tags:

After following all the articles I could find and trying it myself in many different ways, I'm getting a bit desperate towards performing branching and merging in Subclipse.

All I get is tree conflicts (even for example projects), errors ("file already exists")...

I've used svn copy as well (which apparently is a better practice than setting a branch property) as the built-in branch support.

How to branch a directory to a second one, in the best way possible?

And how to merge changes from any of these directiories to the other one?

like image 658
deprecated Avatar asked Nov 03 '11 13:11

deprecated


People also ask

How do you merge in subclipse?

(Make sure that you have committed everything you need into branch .) Team --> Switch to another branch/tag/revision... your working copy to trunk (the target of your merge operation), and resolve any conflicts that come up at this point. Team --> Merge opens a dialog where you will be performing the merge operation.

What is branching strategy in svn?

Subversion Branching Strategies Subversion 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.

How do I merge from one branch to another in svn?

You can merge specific changesets from one branch to another by naming them in the merge arguments: passing -c 9238 to svn merge would merge changeset r9238 into your working copy.


2 Answers

So I figured it out:

Creating the branch

Right-click the trunk folder, select Team > Branch/Tag. The Copy to URL: path must be an absolutely new, non-existing path; you can't either select an already existing path, or create a directory through the dialog and then choose that one.

Then click finish unless you need something else.

Switching to the branch

Update to HEAD, right-click the project folder, select Team > Switch to another Branch. Click the Select... button. If the folder you just created doesn't appear, right-click the browser and refresh. Done.

Merging from the trunk to the branch, or viceversa

First, make sure the Collabnet Merge Client is installed. You'll find it in the same directory that one uses to fetch Subclipse 1.X. Otherwise chances are you'll get tree conflicts.

Right-click either the branch or the trunk select Team > Merge. Choose Merge a range from revisions if the merge goes from the trunk to the branch. Otherwise select Reintegrate a branch.

Click Next. Select the merge source and you're done.

like image 172
deprecated Avatar answered Nov 15 '22 13:11

deprecated


You should only branch and merge the whole project. Not individual directories inside the project. It makes things much simpler. For how to do it, refer to the SVN book. It's very well explained and details the usual techniques : feature branches, maintenance branches, etc.

http://svnbook.red-bean.com/

like image 27
JB Nizet Avatar answered Nov 15 '22 13:11

JB Nizet