Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge two branch revisions using Subversion

Tags:

svn

I'd like to merge all the changes that took place between rev 10 & the HEAD rev on http://url-of-branch-a and apply them to http://url-of-branch-b.

Something like...

svn merge -r 10:HEAD http://url-of-branch-a  

Is this possible? If so, what is the syntax?

I am running the SVN client from the unix command line. The SVN client version is 1.4

EDIT: Yes, my specific solution was...

  1. change directory to the location of my working copy that wants to receive the changes (branch-b)
  2. svn merge -r 10:HEAD http://url-of-branch-a

This merges the changes from 'branch-a' into 'branch-b'

like image 358
user62732 Avatar asked Aug 12 '09 14:08

user62732


People also ask

How do I merge two svn revisions?

To merge a range of revisions, use svn merge -r start:end from to where start and end are revision IDs. This will merge all revisions starting at start+1 up to and INCLUDING end . Note: it will NOT include the first revision (ex: -r3:45 will merge 4 through 45).

How do I merge changes from branch to trunk in svn?

You want to checkout a working copy of trunk and then use the svn merge --reintegrate option: $ pwd /home/user/project-trunk $ svn update # (make sure the working copy is up to date) At revision <N>. $ svn merge --reintegrate ^/project/branches/branch_1 --- Merging differences between repository URLs into '.

What is Subversion merge?

And when you're completely finished with your branch, your entire set of branch changes can be copied back into the trunk. In Subversion terminology, the general act of replicating changes from one branch to another is called merging, and it is performed using various invocations of the svn merge subcommand.

What is svn reverse merge?

Reverse merge In SVN SVN will keep common file contents in working copy from the specific revision of file and HEAD revision of working copy. if it is folder level. In SVN reverse merge, if not file found in the specific revision, it keeps the working copy as it is.


2 Answers

The process is as follows:

  1. Establish a working copy of branch B (svn checkout http://branch-b)
  2. Merge changes from branch A into working copy of B (svn merge -r 10:HEAD http://branch-a .)
  3. Commit (after resolving conflicts) working copy B to branch b (svn commit)

Check the man page (help file) for svn merge semantics. It shows you that svn merge always dumps the results into a working copy.

Check out the SVNBook for all the details.

like image 196
Jamie Hale Avatar answered Sep 21 '22 00:09

Jamie Hale


Checkout URL A. Use SVN merge to merge URL B to your working copy of A. Commit A.

Or vice versa of course :)

like image 23
Billy ONeal Avatar answered Sep 24 '22 00:09

Billy ONeal