Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between "svn merge --reintegrate" and svn merge without reintegrate if I'd like to merge a branch onto the trunk

Tags:

In the svn book it says merge's --reintegrate is "to merge all of the source URL's changes into the working copy".

I would like to merge a branch back to the trunk. Some places say that it's "absolutely necessary" to call reintegrate when merging and then delete the branch immediately afterwards, which I think is a hassle. Other places do not mention reintegration at all. I have svn 1.6.11.

So I'm not sure what to do now.

like image 664
HaoQi Li Avatar asked Aug 15 '13 18:08

HaoQi Li


People also ask

What is svn reintegrate?

In the svn book it says merge 's --reintegrate is "to merge all of the source URL's changes into the working copy".

How do I merge two svn revisions?

To merge a range of revisions, use svn merge -r start:end from to where start and end are revision IDs. This will merge all revisions starting at start+1 up to and INCLUDING end . Note: it will NOT include the first revision (ex: -r3:45 will merge 4 through 45).


1 Answers

A sync merge is something completely different than a reintegration merge. The former is used to merge all changes made on the parent branch to the target branch (typically a feature branch), that have not already been merged. The latter is used to merge a (feature) branch back into the parent branch. Basically that means a temporary clone of the (feature) branch is created, a sync merge is made from the parent branch to the temporary branch, and finally the parent branch is replaced by the temporary branch. In other words, the temporary branch contains all changes made to the (feature) branch and parent branch.

For some reason, some developers do not understand the difference. So, the SVN developers removed the option --reintegrate in SVN 1.8. With this version, the tool detects automatically, if a sync merge or a reintegration merge should be used.

If you use an older version, you should use the option --reintegrate for reintegration merges. Note that the (feature) branch can still be used after reintegration, if you keep some things in mind. The SVN book explains it well:

  • Reintegrating a Branch
  • Keeping a Reintegrated Branch Alive
like image 71
nosid Avatar answered Oct 22 '22 06:10

nosid