Our method for merging branches back to trunk:

  • branch> svn merge from trunk [rev_last_merged_from_trunk]:[HEAD]
  • branch> (resolve conflicts, deploy, test)
  • branch> commit
    (at this point, the branch should be exactly what trunk has plus all changes done in the branch)

  • trunk> svn merge from branch [rev_first_branched_from_trunk]:[HEAD]

For some reason svn still sees a ton of conflicts when doing that last step. In the past I would have to manually go through each file and just copy what was in the branch on top of trunk and then “mark resolved”. However, now there is a faster way: Using at least SVN v1.5 at command line:

svn resolve -R --accept theirs-full *

Thats it! Its a life saver. Or at least a time saver.

(This can be dangerous. Make sure you have resolved all true conflicts in the branch before doing the “resolve all”)

This is in the babble category tagged as

5 comments »

5 Responses

  1. jimbo Says:

    You want to use the –reintegrate option on merge on the merge back from the branch.

  2. Ivan Alfaro Says:

    Correction: svn resolve -R –-accept theirs-full *

  3. Ben Says:

    WP was “helpfully” changing the — to the extended hyphen for me automatically. I added some pre tags to prevent that. Thanks Ivan!

  4. haroon ur rashid Says:

    Thats it! Its a life saver. Or at least a time saver.

    (This can be dangerous. Make sure you have resolved all true conflicts in the branch before doing the “resolve all”)

  5. Rob Says:

    This is very dangerous if you don’t know what you are doing, as you can lose a lot of work, since you haven’t committed your own work yet due to the conflicts.

    Check out this tutorial that explains how to resolve conflicts in subversion:

    http://www.duchnik.com/tutorials/vc/svn-conflicts

Leave a Comment




Your comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.