SVN – Merge trunk revisions into branch

While working on one of our projects which uses SVN for version control, I had to merge in some changes from trunk to the branch. I did this as explained below:

First checkout the branch where you want to merge revisions from trunk

svn co http://svn_repo_url/project/branches/branch my_branch
cd my_branch

svn log -v --limit 100 # list most recent 100 svn commits with messages

Say you want to merge trunk revisions 101, 102, 103 and 104 into branch
svn merge -c 101 -c 102 -c 103 -c 104 http://svn_repo_url/project/trunk

You should see something like this for all the revisions which get merged into the branch.

--- Merging r101 into '.':
U file1.rb
A file2.rb
--- Recording mergeinfo for merge of r101 into '.':

Resolve conflicts if any and commit.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s