TortoiseSVN merging branch to trunk

71,326

Solution 1

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.

Solution 2

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

Share:
71,326
merk
Author by

merk

Updated on September 28, 2020

Comments

  • merk
    merk over 3 years

    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
    merk over 10 years
    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.
  • Micha
    Micha over 10 years
    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?
  • merk
    merk over 10 years
    No, I only have 2 options when i select merge. I do not have the reintegrate branch option.
  • Micha
    Micha over 10 years
    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.
  • merk
    merk over 10 years
    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?
  • Micha
    Micha over 10 years
    Not really. Maybe Subversion Version ... which Version do you use? I'm not sure but Version < 1.7 can cause the missing option.
  • merk
    merk over 10 years
    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.
  • Micha
    Micha over 10 years
    Ok, looking forward to your feedback. Would be interesting to know way you can see all options.
  • merk
    merk over 10 years
    Looks like the option you are talking about was actually removed recently from tortoisesvn 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 ?
  • Micha
    Micha over 10 years
    Seems to be so. but this confirms my recommendation to you to use first option.
  • merk
    merk over 10 years
    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?
  • Micha
    Micha over 10 years
    New question here will make thinks confusing. So my recommendation: post new question and the link to the question here.
  • merk
    merk over 10 years
  • DataDino
    DataDino over 6 years
    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