37

I know this has been asked several times so I apologize for asking it again, but I just want to be sure I understand the difference between the different merges.

I'm the only dev on this project so I'm not worried about over-writing other peoples work.

I created a branch of this project because i was about to add some new features and in the event i needed to fix any bugs in the current code, I didn't want to have to deal with working around half finished code. So trunk contains the 'stable' release and the branch is basically alpha/beta build.

Before i had a chance to really start on those changes, i wound up fixing several bugs and committed them to the branch build. I want to merge the branch back into trunk to commit those fixes, and then I can start on my changes working on the branch.

When i go into TortoiseSVN and select merge, i have two options: Merge a range of revisions OR Merge two different trees

First one says its for when I've made revisions to a branch or trunk and want to port those changes to a different branch

Second one says it's when i want to merge the differences of two different branches into my working copy.

When i try the first option, URL to merge from i pick my branch and all revisions. Click next and when i click test I get a tree conflict over some files that were moved/deleted/added.

When i try the same thing with the 2nd option (using a test merge) using head revision, it seems to work. Which is the correct method? or are neither of them correct for what i want to do?

merk
  • 1,721
  • 5
  • 23
  • 39

3 Answers3

34

In your case I think you don´t need Merge two different trees, because your trunk and branch have a relationship, so this not what you need.

Reintegrate a branch is that what you need if you want bring changes from branch to trunk.

You can use Merge a range of revisions for merge from trunk to branch (update to newest stable version), but also for merge branch to trunk (I work mostly with this option).

Maybe this SO-Question can also help you and here is the "standard literature" for the topic.

Update:

(Tortoise) Merge-Options:

enter image description here

Update II:

(Tortoise) Merge-Options in current Version:

enter image description here

"Merge a range of revisions" is normally used for a "branch to trunk"-Merge.

Community
  • 1
  • 1
Micha
  • 5,117
  • 8
  • 34
  • 47
  • 7
    I've seen several people mention reintegrate a branch, but i do not see that option. I see it listed on the SO-question you linked to in the screen grab, but when i go to merge, i only have merge a range, or merge two different trees. – merk Aug 28 '13 at 19:27
  • What did you mean with "but when i go to merge, i only have merge a range, or merge two different trees". Adding screenshot to my answert -> do you have this three options? – Micha Aug 29 '13 at 05:21
  • No, I only have 2 options when i select merge. I do not have the reintegrate branch option. – merk Aug 29 '13 at 21:00
  • Is "reintegrate branch" greyed out? However, so first option is best for you. Some tree-conflicts are not unusual if you have done some structural changes. – Micha Aug 30 '13 at 05:34
  • it's not greyed out - it's just not there at all. I only have the two other options i mentioned. Any ideas why it's missing? – merk Aug 30 '13 at 19:17
  • Not really. Maybe Subversion Version ... which Version do you use? I'm not sure but Version < 1.7 can cause the missing option. – Micha Sep 02 '13 at 05:01
  • 1
    I'm using the latest version of subversion and visual svn server. although it's possible i was using a version lower then 1.7 when i initially created the branch and switched my working copy over to that branch. I'll test it at work tomorrow by making another branch and seeing if i then get the option to reintegrate. – merk Sep 03 '13 at 07:26
  • Ok, looking forward to your feedback. Would be interesting to know way you can see all options. – Micha Sep 03 '13 at 09:06
  • Looks like the option you are talking about was actually removed recently from tortoisesvn https://code.google.com/p/tortoisesvn/issues/detail?id=516 According to that, the reintegrate option was actually the same as picking merge a range of revisions and just leaving the range of revisions blank. So i guess maybe you are still using an older version of tortoise ? – merk Sep 03 '13 at 20:20
  • Seems to be so. but this confirms my recommendation to you to use first option. – Micha Sep 04 '13 at 06:44
  • Bit confused here - created a new branch from my working copy and let it switch my working copy to that new branch. Edited two files. Went to merge revisions and all I seem able to do is merge the trunk into my working copy, which is the exact opposite of what i want to do. I want to merge my working copy into the trunk. Tried checking off reverse merge but that seems to have effect, or at least no effect when i do test merge. To make it more complicated, another dev just checked in some changes into trunk. So do i want to do a tree merge merging from TRUNK into my new branch? – merk Sep 21 '13 at 00:02
  • New question here will make thinks confusing. So my recommendation: post new question and the link to the question here. – Micha Sep 23 '13 at 05:18
  • Here's the new question http://stackoverflow.com/questions/18970598/tortoisesvn-merging-a-branch-to-trunk – merk Sep 23 '13 at 23:34
9

The new version of tortoise svn removed the reintegrate branch. Instead the merge a range of revisions is handling this.

Checkout the discussion Tortoisesvn Subversion 1.8 - merge - no more reintegrate a branch option

Community
  • 1
  • 1
DiAgo
  • 351
  • 4
  • 6
  • From the SVN 1.8 docs: "The term “reintegrating” comes from the merge option --reintegrate. This option is **deprecated** in Subversion 1.8 (which automatically detects when a reintegrate merge is needed), but is required for Subversion 1.5 through 1.7 clients when performing reintegrate merge." [link](http://svnbook.red-bean.com/en/1.8/svn.branchmerge.basicmerging.html) – DataDino Aug 31 '17 at 17:20
4

Under the merge dialog, there is an option to "merge (old style)"

Old style Reintegration