dserodio ([info]dserodio) wrote,
@ 2006-08-24 21:20:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Current mood:Tired
Current music:DJ Tiesto - Smirnoff Experience
Entry tags:subversion eclipse tips

How to branch with Subclipse
Nice advice on the subclipse-users mailing list by Mark Phippard

Easy way:
  1. Team -> Create Branch/Tag Specify URL to store it, and be sure to select option to create from working copy. Since your project is still on trunk after this completes, you have to do a Revert to get the project back to a pristine condition.
  2. Use Team -> Switch when you want to go back to the branch code.

Better way:
  1. Do Team -> Update on your project so that your entire working copy is updated to a single, known revision.
  2. Do Team -> Create Branch/Tag and create a branch directly in the repository using that known revision.
  3. Do Team -> Switch to swap your working copy to the branch. Since it was already based on that revision, this will be quick and simple.
  4. Do Team -> Commit to commit your changes to the branch.
  5. Do Team -> Switch to swap back to trunk.

Why is this "better" when it is so many steps? It separates the creation of the branch from the commit of your changes. This makes it easier to create a patch with your changes, or to later merge them back to trunk. The "easy" method is fast and simple way to stash your changes but it will be harder to later reintegrate those changes to the trunk.



(4 comments) - (Post a new comment)


[info]bpfurtado
2006-09-01 11:15 am UTC (link)
Nice tips! most of users I've worked don't even know that Branch exists. Good tips on that are always welcome :) As source code versioning tools are one of the most important in our field.

(Reply to this)


[info]rickwoods
2009-05-15 06:18 pm UTC (link)
Thanks! This entry was one of the first few hits on Google for "subclipse commit branch" :-)

(Reply to this)

Is this also possible with multiple users
(Anonymous)
2009-09-16 02:07 pm UTC (link)
Hi,
I wondered if the switch is also possible if multiple users are working on one project?
Lets say i spin of a copy of my trunk version to a branch, then i switch it so that it appears to me the branch is in my trunk. then i develop....
Does this switch also affects now my colleage who works on the trunk?
Please if someone knows just post it here

(Reply to this) (Thread)

Re: Is this also possible with multiple users
[info]dserodio
2009-09-16 02:49 pm UTC (link)
If your working copy was switch'ed to a branch, you'll commit to this branch and the trunk won't be affected.

The trunk will only be affected when you merge your changes to from the branch to the trunk .

Regards,
Daniel Serodio

(Reply to this) (Parent)


(4 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…