I wanted to merge one revision I made in the trunk into one of the branches. So, I used Subversion’s
svn merge command to accomplish this. Thanks to Ray M. for explained the Subversion merge command to me. Here are my notes:
Before I start, I identified the following information:
- The target revision number in trunk that I wanted to merge into the branch. In this case, I assigned a revision number of 100.
- The full URL for the trunk. I found this information by running
svn infoand looked for
Repository Root. In my environment, the trunk is simply [Repository Root]/trunk.
With the above information, I was ready to do a dry-run to make sure the command produced the outcome I wanted. Here is what I ran:
cd [local branch directory] svn merge -r99:100 --dry-run [Repository Root]/trunk
I basically changed directory into the branch where I want merge the trunk revision to. Next, I ran the
svn command with the
merge sub-command. For the revision numbers, I specified the revision I wanted to merge from the trunk as the second number and the first number was simply the second revision minus one. This essentially said to merge changes that happen between revision 99 and 100, which was equivalent to all the changes committed in revision 100. The URL to trunk told the merge sub-command where to look for the specified source revision number.
Once I was happy with the dry-out output, I ran the command again without the
--dry-run option. This effectively merge revision 100 from trunk into the branch. Right after that, I ran
svn diff to check if the diff output was what I expected before I commit the changes.