Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: Can you merge a single check-in into another branch?

Tags:

merge

svn

checkin

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?

like image 917
oscilatingcretin Avatar asked Dec 17 '22 01:12

oscilatingcretin


2 Answers

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.

like image 90
oscilatingcretin Avatar answered Jan 14 '23 16:01

oscilatingcretin


Yes. See the manual section on "cherrypicking".

like image 44
slowdog Avatar answered Jan 14 '23 18:01

slowdog