SVN – Reintegration Merge error: “must be ancestrally related”

Using TortoiseSVN – when I use Test Merge, I get the error “http://mysvnserver/svn/main/branches/ProjectA must be ancestrally related to http://mysvnserver/svn/main/trunk/ProjectB”

What can I do to resolve this?

  • Attaching a binary to a Git tag
  • git server synchronises with svn server
  • Can I create a Subversion repository starting at another number?
  • svnserve and SASL problem
  • What are the pros and cons of the SVN plugins for Eclipse, Subclipse and Subversive?
  • Migrate SVN to git with cleanup
  • Performance in Subversion vs. SourceSafe
  • How can I downgrade the version of an SVN working copy?
  • Is `hg pull --rebase` analogous to `svn update`?
  • Repair SVN Checksum
  • Scalable (half-million files) version control system
  • subversion status code 404
  • 8 Solutions collect form web for “SVN – Reintegration Merge error: “must be ancestrally related””

    I just went through a similar problem, wanted to add the issue and solution I hit. The branch was made from a SUBFOLDER of trunk and not the entire tree. Thus, when I tried to reintegrate, I was mismatching hierarchies. Simply restructuring the integrate to be to the proper subfolder of my trunk WD allowed the process to proceed.

    Adding in hopes this might aid someone who hits this Q/A. 🙂

    Let me guess: the projects are not related? Look up the history, if one of them ever was branched or not.

    Immediate solution: either merge per hand or try command line with “svn merge –ignore-ancestry”

    As davebytes mentioned, this problem can occur when you branch trunk\X into branches\Y, but then move X into a new folder Z, i.e. trunk\X\Z.

    If you just try to merge a change on branches\Y into trunk\X, you will get lots of conflicts; if you just try to merge branches\Y into trunk\X\Z, you will get the “ancestrally related” error.

    But, the SVN manual describes the underlying problem: svn merge should really be called svn diff-and-apply. What you should instead be trying to describe in this scenario, is that you are trying to sum up the changes that occured from r100 to r200 of branches\Y, and apply these changes to trunk\X\Z\.

    In TortoiseSVN, this is the merge two different trees scenario to your local working copy of trunk\X\Z, with r100 of branches\Y set as “from”, and r200 of branches\Y set as “to”.

    We have run into this problem because of the following:

    Created a folder with the repo browser of TortoiseSVN and used it as a branch. Afterwards we tried to merge the manually created folder into the work folder.

    Solution is: Don’t create a branch manually in first place, instead use the TortoiseSVN -> Branch/tag… option to create a branch.

    Hopefully this will be helpful.

    At first I tried to merge in the root folder and got the error, then I browsed to the specific folder where I wanted to merge and then selected the right folder to merge from.

    Example,

    In my branch, I have project structure:

     -Root    
        - Code
        - DB
    

    I created a tag and changed into the DB folder of the tag. Now I want to bring the changes of the tag to the branch. So, I switched to my branch and tried to merge and got the error “must be ancestrally related”.

    So the solution was,

    I browsed to "DB" folder in branch, right click and select Tortoise SVN->Merge-> Merge a range of revisions -> 
    

    Now, from the URL to merge from, I selected:

    the "DB" folder from my tag.
    Then, "test branch". Everything worked fine :D
    

    So, then I clicked the “Merge” button.

    This error might occur if you have a file named exactly like one of the branches (or trunk):

    # svn switch ^/trunk
    Updated to revision 123.
    # ls
    file1
    file2
    v1
    # svn merge --reintegrate ^/branches/v1
    svn: E195016: ^/branches/v1@123 must be ancestrally related to ^/trunk/v1@123
    

    To solve this add current dir to the command (note the dot):

    # svn merge --reintegrate ^/branches/v1 .
    

    This is a real life example, it costed me couple of very unpleasant hours. 🙁

    I was merging with another project. Caused this issue. I merged with the correct branch then it worked fine. My bad, dyslexia

    I’ve had the same error and the reason was about permissions.

    The problem was because one developer tries to integrate changes from one branch he has read/write access to another one he also has read/write access but the last one is a branch created from another branch which he just has a read access.

    Here is the structure with permissions (r = read, w = write):

    trunk (r)
    develop (r)
    QA (rw)
    branches
    featureBranch1 (rw)

    In this case, develop has been created from trunk, QA from develop and featureBranch1 from develop. The fact that he try to reintegrate featureBranch1 into QA which was a branch created from develop and he don’t have access in write to develop is in our case the problem why he receive this message when trying to reintegrate featureBranch1 in QA.

    Immediately after giving him access in write to develop, the message disappear.

    Git Baby is a git and github fan, let's start git clone.