mridula
mridula

Reputation: 3281

How do I resolve the tree conflict when merging branch with trunk in SVN?

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.

Upvotes: 2

Views: 9526

Answers (3)

Lazy Badger
Lazy Badger

Reputation: 97282

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

Upvotes: 0

Nicola Musatti
Nicola Musatti

Reputation: 18218

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.

Upvotes: 1

Micha
Micha

Reputation: 5163

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'.

Upvotes: 2

Related Questions