Tuesday, 18 October 2011

SVN: Merge Branch to Trunk

We are still using subversion instead of git, hopefully someday we can migrate. In the meantime I still struggle with some of the basics. From now on I will at least know to check this blog whenever I want to merge. The following method assumes no development is done on trunk, only branches are merged to it once a new release is ready.

First, we need to make sure we have all our changes in our working copy checked in before we proceed. Then we check out the trunk and switch to it:  
svn co http://server/repository/project/trunk 
svn switch http://server/repository/project/trunk 

Now we can merge:  
svn merge http://server/repository/project/trunk http://server/repository/project/branches/MyBranch 

Finally we can commit to the server:
svn ci -m "Merge MyBranch to Trunk"

Finished. :)