2

I have a project in the 'trunk' folder. When I needed to create a branch, I copied the contents of the 'trunk' folder into a new 'branch' folder. As a result, the directory structure looks like this.

Folder Structure

Now I want to merge the contents of the branch and the trunk into the trunk folder. How can I achieve that?

I tried by selecting 'Merge two different trees' from the Merge menu of tortoise SVN.

I entered the trunk URL in the FROM field and the branch URL in the TO field.

However, it gives the error 'Tree Conflict' for every folder because the names of the folders in 'Trunk' and 'Branch1' are the same. I want the contents of these folders to merge.

mridula
  • 3,203
  • 3
  • 32
  • 55

3 Answers3

2

I copied the contents

You should use create branche function (branch/tag in windows context menue when using tortoiseSVN), so the branch and trunk will know there relationship. This is imported to avoid tree conflicts

I tried by selecting 'Merge two different trees'.

Better use 'Reintegrate a branch' (best for your purpose) or 'Merge a range of revision'.

Micha
  • 5,117
  • 8
  • 34
  • 47
  • Yes, but I can't help it now. I have already made changes in the branch and cannot use the branch function now. Can I still use reintegrate branch? – mridula Jun 20 '13 at 10:24
  • 1
    Not the best starting position, but I would try it. Can you create a new branch and transfer your changes to it? – Micha Jun 20 '13 at 10:29
  • Yes, instead of merging all the changes manually to the trunk, the approach suggested by Micha will be less time consuming. – Rajkumar Jun 20 '13 at 11:53
  • Thanks. I create a branch using Tortoise SVN, exported the contents of my branch there and then merged using "Reintegrate a Branch'. – mridula Jun 20 '13 at 12:31
  • @Micha - I have made changes in both trunk and branch. When I integrated the branch back in the trunk, some of the changes in trunk were lost. How can I keep changes in both while merging? – mridula Jun 21 '13 at 05:00
  • @mridula - Normaly booth changes will keep, when use branches created with svb-branch-functionality. Hard to tell what goes wrong - need more information. – Micha Jun 21 '13 at 05:09
  • I had to first merge the trunk into the branch using `Merge a range of revisions` and then from the branch back to the tree using `Reintegrate a branch`. – mridula Jun 21 '13 at 09:09
  • Your line of action sounds good to me. The concrete Code my be the reason, but its hard to tell. Maybe you can create a new question with a example of code an your steps (post link here). – Micha Jun 21 '13 at 09:15
1

Checkout your trunk and your branch in different directories and perform your merge with WinMerge.

Then consider removing your branch and recreating it again properly.

Nicola Musatti
  • 17,834
  • 2
  • 46
  • 55
0

If Branch1 is modified tree of Trunk and you want merge changes from branch to trunk, you have to:

  • Read SVN book, where process of merge is clearly written
  • Use this knowledge
    • Checkout thunk into clean, unmodified Working Copy
    • in this Working Copy select in TSVN context menu "Merge" - Merge Branch (1.7 version, from memory, I have now 1.8 TortoiseSVN)
    • Enter full or relative URL to branch
    • Merge (or perform test-merge before real merge)

enter image description here

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110