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

Re: order of merging around trunk and branch

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-08-20 09:57:10 CEST

On Aug 19, 2007, at 22:20, Steven Woody wrote:

> since a branch B had been created out of trunk T, changes have
> happened on both T and B for many files ( with the same names ). now
> if i want to synchronize T and B, what do i do? merging changes on B
> to T followed by merging changes on T to B or do it conversly?

Neither. Generally you will want to do either one or the other:
incorporate branch changes into the trunk, or incorporate trunk
changes into the branch.

To merge branch changes into the trunk:

cd working_copy_of_trunk
svn merge $REPO_URL/branches/my_branch -rA:B

...where A is the revision in which the branch was created, and B is
the HEAD revision.

That assumes you have not yet merged anything from the branch into
the trunk. If you have, then A is instead the revision at which you
performed that last merge.

It also assumes you never merged anything from the trunk into the
branch.

To merge trunk changes into a branch:

cd working_copy_of_branch
svn merge $REPO_URL/trunk -rA:B

...where A is the revision in which the branch was created, and B is
the HEAD revision.

If you want to then merge the branch changes into the trunk:

cd working_copy_of_trunk
svn merge $REPO_URL/branches/my_branch@B $REPO_URL/trunk@B

...where B is the same revision as in the above merge.

The above is from memory, but I hope it's correct. Merging is covered
in greater detail in the book at
http://svnbook.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 20 09:56:10 2007

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.