SVN Merge three different ways

Source: Internet
Author: User

1. Merge a range of revisions

2, reintegrate a branch

3. Merge different trees

——————————————————————————————————————————————————————

Here is an article on the SVN branch merge type reproduced from Chunanyong, Source: http://chunanyong.iteye.com/blog/697255

The work of merging is to list all changes in the consolidated scope of the trunk or branch, and to compare the contents of the current working copy, manually modify the conflict by the Consolidator, and then submit it to the appropriate directory on the server. If the current working copy is a trunk, the merge scope is a change on the branch, and if the working copy is branched, the merge scope is a change on the trunk, 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 of application is most widely used, mainly to merge the changes in the branch into the trunk. Right-click on the trunk to select Merge and 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 the versions on the merge branch, that is, since the branch was created, all the changes to the current version of the branch. If you select only one version, or several versions, you are simply merging the changes made in n versions onto the trunk. If you select only one of these versions, then the change is only selected for that version, and the previous or subsequent modifications will not be accepted.

Ii. Rehabilitation and merger

Renaissance merging can be understood as a special case of the first type of merging, in which the trunk can be understood to be that there has been no modification since the branch was created, and that the branch has been modified, and that the branch in the merge has no version selected. After a revival merge, all the changes in the branch are merged into the trunk, and the results of the merge will make the branches and trunk identical, so that the branches can be deleted.

Iii. merging two different trees

This type differs from the first two types in that it is possible to select the version of the branch merge, the trunk cannot select the version, and the second type is that both the trunk and the branch cannot select the merged version, and this type is the version that can be merged whether the trunk or the branch is selected. That is, you can select a trunk version of the past to merge with a version of the branch. Merging is based on the selected branch version, and if the selected trunk version differs from the branch version, the trunk portion is discarded when merging.

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

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

Start and end versions: the general starting version should find the version that was last synchronized, if it has never been synchronized (the first merge), select the version when the branch was created, the end version is generally the latest version, and if you don't want to merge some content into the trunk, you can also select a merge point.

Instance:

Trunk A creates branch B at version 95, when both trees are 95 versions

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

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

3, I select merge Type 2 on a, merge the latest version of the branch, the result is as above;

4, I select merge Type 3 on a, merge the latest version of the branch, the result is as above;

5, I add File test2.txt on a, submit, this time the repository upgrade to the 97 version;

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

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

8, I select merge Type 3 on a, the backbone selects the current 97 version, merges the latest version of the branch, the result is to add Test.txt A, the test2.txt from a delete.

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

Merging the branches into the trunk begins with the working copy of the trunk, which begins with the last consolidated version of the trunk to the end of the latest version on the branch, and, if it is the first merge, starts with the version of the trunk to create the branch, so each merge is illustrated in the log , Or forget the next time the merger is a bit of trouble. In fact, should try to avoid a branch merge multiple times, the role of the branch in general in order to solve the bug, once the bug corresponds to the end, the branch of the mission is over, and other problems later, you should re-establish the branch, so that there will be no multiple merging problems.

SVN Merge three different ways

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.