Thursday, February 7, 2013

easy svn merges?!?

Here is what you need to do to merge the changes from your long-living personal branch into trunk:

1. Back merge from trunk to your branch working copy
>>svn merge <svn_root_url>/trunk/<component>

2. Commit the branch working copy
>>svn commit -m "backmerge from trunk"

3. Reintegrate merge from branch to trunk working copy
>>svn merge --reintegrate <svn_root_url>/branches/<branch_name>/<component_name>

4. Commit the trunk working copy
>>svn commit -m "<meaningful message> ... <codereview url> ..."

5. Record-only merge to your branch so that you can continue using it
>>svn merge -c<revision_number_from_step_4> --record-only <svn_root_url>/trunk/<component_name>

6. Commit the merge from trunk
>>svn commit -m "record-only <rev_number> from trunk"

2 comments:

Rares Rusu said...

now you surely must be using svn because you are forced to by corporate policies, and not by your own choice.
I must admit there are far worse (corporate) alternatives where you wouldn't even consider to do a merge (read Perforce).

Lucian Ciufudean said...

you're darn right it's a corporate policy, but it is the same corporate policy that forced us to switch from clearcase to svn, which was a relief :)