SVN branch Development and backbone merging (branch & merge) __SVN

Source: Internet
Author: User
Tags svn tortoisesvn

[Reprint Address: http://blog.csdn.net/zhouyong0/article/details/7968667, the original address is not clear]

I'll show you how to do a complete branching and merging, including branching, branching, branching, and mainline synchronization, the whole process of branching to the mainline, and even how to create a test repository locally.

First need to install TORTOISESVN, I installed the version is: TortoiseSVN 1.6.15, Build 21041-32 Bit, 2011/03/23 18:00:27

1, the creation of local repository

Repository is simple to create, assuming that I want to create repository in the D:\TortoiseSVN\TestRepository directory, just right-click testrepository directory and select TortoiseSVN-> "Create repository Here" will complete the creation of repository.

2, Check out

Suppose you want to Check out to D:\TortoiseSVN\TestSVN, it's also easy to create a TESTSVN directory under the D:\TortoiseSVN directory, then right-click on the directory and select "SVN Check out ..." In the pop-up window " URL of Repository "" file:///D:/TortoiseSVN/TestRepository, other default can be, finally click OK.

3. Trunk Create new Project MyProject

It's quite simple to go over it, just list the changes made by this operation:

4. Create Branch

Right-click on the/trunk/myproject directory, select "TortoiseSVN"-> "Branch/tag ..." and fill in the address of the branch in the "to URL" of the pop-up window, where the target revision select Head revision , as shown in the following illustration, the Click OK Branch after adding log is established. This operation is very fast, the new branch in Repository is actually just a point to trunk a revision soft connection, and there is no real copy of the file.


5. Check out Branch

Right-click the TESTSVN directory to select "TortoiseSVN Update" to download the newly established branch back to the local. Enter the/branches/myproject directory and you will find that the file structure is identical to the/trunk/myproject.

6, Branch submit a new document

7, Trunk immediately after the submission of a modification

8, Branch again to submit a modification

9, synchronize the changes in the trunk to the branch

6-8 demonstrates that branch and trunk are developed independently and in parallel. In order to prevent the "wrong" way to go farther and further, now branch realize it is time to sync with trunk (trunk to branch).

First, in the local trunk first update, there is conflict resolution conflict, to ensure that trunk and repository have been fully synchronized, and then on the/branches/myproject right, and then select "TortoiseSVN"-> "Merge ... ", select the first" merge a range of revision "in the pop-up window, this type of merge has been introduced very clearly to merge the changes between multiple revision submitted on a branch or mainline into another branch.


After clicking Next, the following window appears:

Since it is to be merged from the trunk to the branch, it is natural that the "URL to merge from" should fill the trunk path, "Revision range to merge" is well understood, It's what you want to incorporate into the branch of the revision of the trunk, which can be a series of revision, such as 4-7,15-head, or a separate revision number. Since in R4, trunk modifies the Talk () method in Person.java, the revision here is only required to fill in 4. Click Next to show the following image:

Just keep the default settings here. Before clicking on the merge button, you can test the merge to see the success or not, and the details of the merge. After clicking on the merge button, the trunk changes are synchronized to the branch.

10, submitted after the merger of the branch

At this point, Branch has been fully synchronized with the trunk, branch and trunk code get along very well, there is no conflict, if the branch has been developed, it is time to branch merged back Trunk, of course, if the branch will continue to develop, Then you will continue to repeat the 6-10 steps.

11. Merge branch back to Trunk

On the/trunk/myproject, right-click on the main line directory, select "TortoiseSVN"-> "Merge ...", in the pop-up window, the merge type selects the second item "reintegrate a branch" , this type of merge is appropriate to merge all changes back to the mainline after the branch development is complete.


After clicking Next, the following window appears:

In this case, the from URL selects/branches/myproject without selecting the revision number, and reintegrate merges all the modifications on branch to trunk. The following steps, as in the 9th step above, are no longer verbose. If no accident, branch will be successfully merged into trunk, you need to do is to merge the trunk hurriedly commit.

12, submitted after the merger of the trunk

Right-click on the merged item, Temp-> Commit.

13, Delete branch

If you think your new feature has been developed, you can delete your branch.

14, view log information

Here, I've shown you the whole process, but in the end we'll look at all the log information and we can find everything we do through log:

R1-R7 is exactly what I'm doing, and from the message you can find out what I've done to trunk and branch, and in the lower left corner of the Log Messages window, you can see the additional merge, "Include merged revisions." Information:

The

Diagram is gray with the merge-related log, there were two merges, the first in R6, and in R6, branch the changes submitted by trunk at R4, and the second in R7, R7, where trunk merged all the changes branch from R2 to R6.

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.