Merge two branches using tortoise SVN

假如想象 提交于 2019-11-30 11:54:23

问题


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?


回答1:


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

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

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

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

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

 Finaly merge is completed[picture6]

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




回答2:


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.



来源:https://stackoverflow.com/questions/18308584/merge-two-branches-using-tortoise-svn

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!