[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SVN merge between branches is actually overwrite?

From: Stefan Sperling <stsp_at_elego.de>
Date: Sat, 26 Nov 2016 16:11:15 +0100

On Sat, Nov 26, 2016 at 01:49:00PM +0000, James wrote:
> I just found if I merge branch B to branch A, the two branches will become the same. changes in branch A will gone. Is this by design? or I did something wrong? I am using the latest Tortoise.
>
>
> I did more than once with the instruction found online:
>
> In the From URL option, you should mention the branch to which you have to merge. For example, assume that there are 2 branches branch A and branch B, and you want to merge branch B to branch A. In TortoiseSVN, click on Merge option and then select Merge two different trees option. In the From URL, please mention URL of branch A and in the To URL, mention URL of branch B. This should merge branch B to branch A without loosing any files.
>
> Thanks,James

What you have found online is misleading at best.

TSVN's "Merge two different trees" merge compares two trees A and B,
and merges the difference between them into the working copy folder
which was right-clicked when initiating the merge command.

It is not the "To" input field, but the working copy which determines
the merge target.
"From" and "To" here refer to a comparison of two tree states which yields
the difference (changes) the merge should apply to the merge target.
"From" and "To" do not (necessarily) refer to branches!
I don't know why TSVN developers have decided to use these labels.
I think they are misleading and you're not the first person I have met
to be misled by them.

If you want to merge branch B into branch A, check out a working copy of
branch A, right-click on the root directory of this working copy, and use
the "Merge a range of revisions" merge. There, specify the URL of branch B
to merge from, and leave the revision range field blank (which will
cause all outstanding changes to be merged, instead of just particular
changes).

Hope this helps you!

Stefan
Received on 2016-11-26 16:11:30 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.