Search code examples
svnmergebranching-and-mergingsvn-reintegratesvn-merge-reintegrate

how to do svn reintegration of branches using command line


I have created a new feature branch B from branch A.

Now I want to merge back the branch B into A and delete the branch B.

But I am getting confused about the two terms

  • Merging the branch
  • Reintegrating the branch

I don't understand how this two are different and how can I do that using svn command line.

Any helpful suggestions are welcome


Solution

  • Reintegration is a specific case of merging. Merge is a generic term. But when you merge back a branch (B in your case) to its parent (A), you are reintegrating. svn merge used to have a --reintegrate flag before 1.8. This is deprecated, and you do not have to tell svn anymore that you are reintegrating. It is smart enough to figure it out.

    In your copy of branch A, the command to merge branch B is:

    svn merge URL-to-branch-B
    

    Note that before 1.8, you could not reintegrate the same branch several times, although there is a workaround by manipulating svn merge properties. That is, once reintegrated, you had to delete the branch (best practice). I mention this, because you may collaborate with people with an older version of svn, and you (with the newer svn version) would have to do the merging if you plan to keep a branch alive after reintegration.