ailon's DevBlog: Development related stuff in my life

Merging SVN branch back to trunk with TortoiseSVN

3/31/2009 4:38:35 PM

This post is mostly a note to self, cause if I don’t do this for some time I forget how to do it and spend quite some time figuring things out. Actually this is quite a simple task but awkwardly implemented (from my point of view).

Now I did it for a second time in 2 weeks and managed to merge my branch back to trunk from the first attempt, so I decided it’s good ocassion to write things down so I don’t waste time the next time I forget the procedure.

So, here’s what you do after you are finished working on your branch and want to merge everything back to trunk:

  1. Make sure you’ve commited everything to your branch.
  2. Backup your whole working copy (just in case :)
  3. Switch your working copy to trunk: Right click->TortoiseSVN->Switch. Select your trunk URL, HEAD revision and press OK.
  4. Merge (this is the awkward part): Right click->TortoiseSVN->Merge. In from box select URL of your trunk (HEAD revision), uncheck Use “From:” checkbox in To section and select branch URL in To box. Test wit “Dry run” and press “Merge” if everything is correct.
  5. Commit to trunk

That’s it.

Bonus track: here’s a good article on minimizing merging conflicts when working on branches.

Comments

2/10/2010 7:49:42 AM

L

Hi,

I am used to Clearcase and new to SVN. I find it so confusing to merge in SVN.

If you are trying to merge the branch to the trunk, wouldn't 'From' be the branch and 'To' be the trunk? (with trunk being the work copy)

Could you please clarify?

Thanks.

L Australia

2/10/2010 10:04:55 AM

ailon

As far as I understand the reasoning is that you are moving trunk FROM it's current state TO (more or less) the state of the branch. Hence the awkward FROM/TO combination.

ailon Lithuania

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Copyright © 2003 - 2010 Alan Mendelevich
Powered by BlogEngine.NET 1.5.0.7