Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge two branches using tortoise SVN

Tags:

I have a branch which I am doing the changes seperately. Other team mates doing the changes in trunk. Scenario is, now I want to give a release including trunk updates + my branch updates. Since I haven't done the complete module yet, I don't want to merge branch to the trunk. Instead I want to create another new branch from trunk and then merge my branch changes to that new Branch. So that I can have the new branch fully updated with my branch updates + latest trunk updates.

I'm using tortoise svn merge and this is what I did:

Let's say in trunk there is a newly added file : A, which is not having in my branch. So the newly created branch also having the file A. (I used the merge option: "Merging Two Different Trees") I go to new branch folder and gave that branch url to the [FROM] field and gave my branch url for the [TO] field. When I did the merge it deletes that A file from the local copy. Apparently what I understand is, merging has taken the new branch state to my branch state, instead of integrating the changes.

What I want is to merge my branch changes to the new branch, without loosing the latest changes that new branch is having. So that I can have the new branch: latest trunk modifications + my branch changes.

How to do this?

like image 281
Priyan Perera Avatar asked Aug 19 '13 07:08

Priyan Perera


People also ask

How do I merge two branches on GitHub?

In GitHub Desktop, click Current Branch. Click Choose a branch to merge into BRANCH. Click the branch you want to merge into the current branch, then click Merge BRANCH into BRANCH. Note: If there are merge conflicts, GitHub Desktop will warn you above the Merge BRANCH into BRANCH button.


2 Answers

Perform fresh checkout of your repository  Precondition:( Suppose your repository name: Team ) 1. You have trunk( Main Dev ) 2. You have branch ( Your changes ) 3. Create say "newbranch" from trunk.[ TortoiseSVN->Branch/tag][ Picture1 }Note:Select Head revision 

enter image description here

4. Perform svn Update inside "Team"->So newBranch is updated.[picture2] 

enter image description here

5. Now, select newbranch and merge[Tortoisesvn->Merge][Picture3] 

enter image description here

6. Select default "Merge a range of revision", to select revisions which you only intrested to merge.[[Picture4] 

enter image description here

7. Click, showlog to select required revisions you intrested on[picture5] 

enter image description here

 Finaly merge is completed[picture6] 

enter image description here

**Note: If Conflicts comes across, then merge conflict revisions manually.

like image 151
Ashif Avatar answered Nov 10 '22 01:11

Ashif


I would create a new branch from trunk and than merge your branch in the new branch via Merge a range of revisions. Because the new branch is newer all should work fine.

like image 41
Micha Avatar answered Nov 10 '22 00:11

Micha