Merge a branch with the trunk in Subversion

I restart my blog posting activity by sharing with you a little cookbook that may be useful if you use Subversion to manage your source code repository.

If you are using Subversion, you most likely have already created (or thinking of creating) branches to manage different versions of your source code.

When the time comes to merge my changes between branches or a branch and the trunk, I always forget the syntax, so here's a small step by step merge execution.

I am assuming you have checked out both the branch and trunk from your subversion repository. If you haven't done so, you can easily checkout with:

svn co <repository>

First of all, go to the branch main directory, and execute the following:

svn log --stop-on-copy

The last entry is the version number corresponding to the creation of the branch, and looks something like the following:

r2887 | daniel | 2008-03-25 12:20:52 +0100 (Tue, 25 Mar 2008) | 1 line
Creation of new branch for version 1.6. ------------------------------------------------------------------

So, we have found out that the version is 2887. Now, change directory to the trunk, and execute the following command:

svn up

The output of this command should be something like:

At revision 3117.

Basically, that means that we have to merge the changes from revision 2887 to 3117, using the following command:

svn merge -r2887:3117 https://<repository>/branches/<version>

Now, you should check the changes performed to your local copy, and resolve any change conflicts that may appear.

Once you have verified that the changes are correct, you can check in with the usual svn ci.



 


Trackback

Trackback URL for this entry:
http://www.gra2.com/trackback.php/merge-branch-trunk-in-subversion

No trackback comments for this entry.

Comments

Post a comment

Very useful. Thanks!!
Sumabhat82@gmail.com

Anonymous on Thursday, June 18 2009 @ 12:12 PM CEST Reply | #

Hi People
How are you doing?

mayogmaappedo on Thursday, October 08 2009 @ 02:33 AM CEST Reply | #

JLDm3p http://sjI1mfH9Cx4hsDePoai2v.com

marmont on Friday, July 29 2011 @ 12:42 PM CEST Reply | #

Confirmo. Esto era y conmigo. Discutiremos esta pregunta.
http://www.webddlworld.com/
Boldy

Boldy on Saturday, August 13 2011 @ 01:59 PM CEST Reply | #

i'm fine good work

Mumzlgjn on Sunday, September 11 2011 @ 03:14 PM CEST Reply | #

UPlR2g Cool! You have answered. I'll take a quote! The meaning of life and everything else. Decided. No kidding!...

OEM software online on Thursday, September 29 2011 @ 09:37 PM CEST Reply | #

Hello world

Anonymous on Friday, September 30 2011 @ 11:37 AM CEST Reply | #

http://www.l4kQDD30zNsyoG7pFkTOj6m6mXdUqdwF.com

joseph on Tuesday, January 03 2012 @ 01:51 AM CET Reply | #

http://www.NIzi0QxjqKwVZYJ0oEPJhqfCBoLXzubW.com

trinity on Tuesday, January 03 2012 @ 02:47 AM CET Reply | #

I'm in my first year at university

Tljoguas on Wednesday, January 25 2012 @ 09:49 PM CET Reply | #

I'm in my first year at university

Tljoguas on Wednesday, January 25 2012 @ 09:49 PM CET Reply | #

This is your employment contract

Dpnzudie on Wednesday, January 25 2012 @ 10:13 PM CET Reply | #

Search



About

newton.gra2.com is a blog about technology, opinion and random thoughts written by Daniel Alvarez, a computer engineer currently living in Zurich, Switzerland.

Topics

News (20/0)
Manuals (24/0)
Security (7/0)
Music (3/0)
Weeklog (1/0)
Personal (34/0)
Photos (3/0)
Opinion (14/0)
Windows (5/0)

Blogroll

Pros i contres (Jordi)
Entrepa de fusta (Oriol)
Spaghetti Code (Isaac)
Made in net (Eric)
Nogare (Juan)
Blog de Isaac Jimenez
Web d'en Jaume Benet
Montcada Wireless (Fran)
Blog d'en Ricard Forniol
Angela Fabregues
in.solit.us

Libertad Digital
FOX News
The Wall Street Journal
The Washington Times
The Jerusalem Post

Michelle Malkin
Eurabian News
Nihil Obstat
Barcepundit
Expose the left
Davids Medienkritik
Johan Norberg
Ayaan Hirsi Ali

User Functions

:

:


Lost your password?

Latest posts

Stories

No new stories

Comments last 2 days


Trackbacks last 2 days

No new trackback comments

Links last 2 weeks

No recent new links