4

I know that you can merge two branches together, but what about single check-ins?

For example, I've used SourceGear Vault in the past to merge check-ins. If I modifed several files in my project and checked them all in at once, this was considered a single check-in even though it consisted of multiple files. If I wanted to merge just these changes into another branch without merging the entire branch that may contain someone else's changes that I don't want merged, I could just merge only the files from my check-in.

Can I do this with SVN?

oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206
  • 1
    while at the top of the destination branch checkout: svn merge -c revision_id source_branch – bobah Apr 13 '12 at 12:55

2 Answers2

9

I'll probably get thumbed down for answering my own question when two people have already provided what are probably legitimate answers, but I found a command-line-free way to do this using TortoiseSVN's Windows Explorer integration. I followed these steps:

  • From Windows Explorer, I right-clicked the folder containing the project that's tied to the DESTINATION branch and selected TortoiseSVN > Merge.
  • In the dialog box that popped up, I selected "Merge a range of revisions"
  • In the next window, I selected the SOURCE repository branch that contains the changes I want merged and clicked Show log to get the revision number of the check-in
  • I did a test merge to make sure it worked, after which I proceeded with the merge, checked the working copy of my VS 2010 project, and all my code was there!

FWIW, I upvoted the other guys for good measure.

david.barkhuizen
  • 5,239
  • 4
  • 36
  • 38
oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206
3

Yes. See the manual section on "cherrypicking".

slowdog
  • 6,076
  • 2
  • 27
  • 30
  • -1. Have a look at http://stackoverflow.com/help/how-to-answer on how to write good answers – user Sep 05 '14 at 11:33