Monthly Archives: June 2012

svn merge a revision on trunk to a branch

Merging a set of files from Trunk to a branch

The scenario is that you have made changes to a selection of files and committed them all in one revision.  You then wish to merge only these changes into a branch (e.g. for release).  How can you grab just your changes and merge these?

  1. Find the revision number on trunk that you want to merge into the branch
  2. Check out the branch to your local machine
  3. cd to the branch directory on your machine
  4. make the call: svn merge -c [revision_number] [trunk directory]
  5. svn merge -c 896929 ../trunk

-c gets the differences between the files in the revision you specify and the one before.  It will then try to merge these changes into the branch.

You can use the –dry-run switch to preview the outcome before going ahead with the merge.