Subversion: merging a commit from trunk to branch

How to merge a commit between trunk or branches

  1. Determine the commit number in the source branch. In this example the commit number 344 in trunk.

  2. Determine the source branch URL. You can see this by typeing "svn info" in the top level directory. In this example, the source branch URL is at "svn+ssh://"

  3. Checkout the branch and change directory into it. e.g. use "svn co"

    $ svn co svn+ssh://
    $ cd v2011
  4. Merge changes from revision 344 in trunk to the branch

    $ svn merge -r 343:344 svn+ssh://
  5. You can now commit your changes into the branch.

Published: Sunday, 6 March 2011