Merge two branch revisions using Subversion

Solution 1:

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.

Solution 2:

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

Or vice versa of course :)

Solution 3:

Mostly confuse merge by trying to do in svn repo, we can not directly merge to svn repo, we can merge to working copy of local machine as follows:

  • This working copy should be destination URL of merge(i.e. checkout destination).

  • merge working copy with source URL of merge.

  • commit to destination.

Best Practice : Merge In , Merge Out.