SVN version control--SVN merge three ways

Source: Internet
Author: User
Tags svn

1, the Merge a range of revisions

2, reintegrate a branch

3, Merge two different trees


The following is an article on the SVN branching merge type reproduced from Chunanyong, from the source: http://chunanyong.iteye.com/blog/697255

The merge work is to list all the changes within the merged scope of the backbone or branch, and to compare the contents of the current working copy, by manually modifying the conflict by the Consolidator, and submitting it to the corresponding directory in the server. If the current working copy is a backbone, the merge scope is a change on the branch, and if the working copy is branched, the merge scope is the changes on the backbone, and it is important to note that the starting location URL of the merge must be the same as the URL of the current working copy.

One, merge a range of versions

This type is most widely used, mainly to merge the changes in the branch into the backbone. Right-click on the trunk to select Merge and then select merge type: Merge a range of versions.

The merged source URL fills in the URL of the branch to be merged, and if the version range to be merged is empty, it refers to all versions of the merge branch, which is all the evolution of the current version of the branch since the branch was created. If you select only one version, or several versions, then you are simply merging the changes made in the N version into the backbone. If only one of the versions is selected, then the modification of that version is only selected, and the previous or subsequent modifications will not be accepted.

Ii. Rehabilitation and integration

The revival merge can be understood as a special case of the first type of merge, in which the backbone can be understood to have been modified since the branch was created, and the branch is not selected in the merge. After a revival, all of the changes in the branch are merged into the trunk, and the merged results make the branch and trunk identical so that the branch can be deleted.

Three, merge two different trees

This type is different from the first two types, which can select a branched merge version, the trunk cannot select a version, and the second type is that both the trunk and the branch cannot choose the merged version, and this type is the combination of the trunk and the branch. That is, you can select a previous skeleton version to merge with a version of the branch. When merging with the selected branch version, if the selected trunk version differs from the branch version, the backbone portion of the merge is discarded.

Start URL: Select the URL of the skeleton directory (should match the current working copy's URL, this is the so-called merge point)

End URL: Select the URL of the branch to merge.

Start and end versions: the general starting version should find the version of the last synchronization, if it has never been synchronized (the first time), select the version when the branch was created, the end version is generally the latest version, or you can select a merge point if you do not want to merge some content into the trunk.

Instance:

Backbone A in the 95 version of the time to create branch B, when both trees are 95 versions

1, I add the file Test. txt on branch B, submit. The version library is now upgraded to version 96.

2, I select the merge type 1 on a, merge the newest version of the branch, the result is to add test.txt to a

3, I select the merge type 2 on a, merge the newest version of the branch, the result ibid;

4, I select the merge Type 3 on a, merge the newest version of the branch, the result ibid;

5, I added a file test2.txt, submitted, at this time version of the library upgraded to version 97;

6, I select the merge type 1 on a, merge the newest version of the branch, the result is to add test.txt to A;

7, I select the merge type 2 on a, merge the newest version of the branch, the result is to add test.txt to A;

8, I select the merge Type 3 on a, the backbone selects the current 97 version, merges the newest version, the result is adds the test.txt to a, removes the test2.txt from a.

9, I select the merge Type 3 on a, backbone 97 previous version, merge the latest version of the branch, the result is to add test.txt to a, and a to retain the test2.txt.

Merge the branches onto the backbone, first you need to do it under a working copy of the backbone, the scope of the merge is from the last merged version of the backbone to the end of the latest version on the branch, and if it is the first time, start with the version of the branch from the backbone, so each merge should be illustrated and reflected in the log Or forget that the next merger is a bit of a hassle. In fact, should try to avoid a branch to merge many times, the role of the branch in general to solve the bug, once the bug corresponds to the end of the branch mission is over, and then other problems, should be set up branches, so there will not be many times the problem of merging.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.