Branching and merging in Subclipse
Asked Answered
G

2

25

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?

Glorious answered 3/11, 2011 at 13:27 Comment(0)
G
56

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.

Glorious answered 4/11, 2011 at 15:22 Comment(4)
It wasn't working in my case, because I had a conflict. I had to resolve the conflict generated by this first merge, commit the change and re-run the merge.Sunwise
+1 for "Collabnet Merge Client" -- never knew about this. Makes a nearly impossible job super-easy.Moselle
you can also switch to the branch during it's creation (there is a checkbox for this on the bottom)Agglutination
Is the information about Collabnet Merge Client still valid? I see from this site that it works with Eclipse 3 (first I tried without it, but of course I have problems xD).Agglutination
I
5

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/

Impasse answered 3/11, 2011 at 13:37 Comment(2)
Thanks for pointing out that branching should be project-wise. I understand the SVN basics, my question was specific for Subclipse. Answered the question myself.Glorious
This is quite outdated. It has documentation for SVN 1.7 and in-progress 1.8.Agglutination

© 2022 - 2024 — McMap. All rights reserved.