SVN branch Development and Trunk Merge (branch & merge)

Source: Internet
Author: User
Tags tortoisesvn

SVN Branch MERGESVN Branch and trunk

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

Next I'll show you how to do a complete branching and merging at a time, including creating branches, branching, branching and mainline synchronization, branching into 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

The creation of repository is simple, assuming I want to create repository in the D:\TortoiseSVN\TestRepository directory, just right-testrepository the directory, select TortoiseSVN "Create repository Here" completes the creation of repository.

2. Check out

If you want to Check out to D:\TortoiseSVN\TestSVN, it is also very simple 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 "fill in" File:///D:/TortoiseSVN/TestRepository ", other default can, finally click OK.

3. Trunk to create a new project MyProject

It is quite simple not to repeat, only to list the changes made by this operation:

4. Create Branch

Right-click on the/trunk/myproject directory, select "TortoiseSVN", then "Branch/tag ...", and in the "to URL" of the pop-up window, enter the address of the branch, where the target revision select Head revision , as shown, click OK to add log after the branch is established. This operation is very fast, the new branch in the repository is actually a revision to the trunk of a soft connection only, and did not really copy the file.

5. Check out Branch

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

6, Branch submit a new file

7. The trunk is immediately followed by a modification

8, Branch again to submit a change

9. Synchronize the changes in the trunk to the branch

6-8 demonstrates that branch and trunks are developed independently and in parallel. In order to prevent the "wrong" on the road farther, now branch realize that it is time to synchronize with the trunk (merge trunk to branch).

First, in the local trunk of the first update, there is conflict resolution conflict, ensure that the trunk and repository are fully synchronized, and then right-click on the/branches/myproject, select "TortoiseSVN", then "Merge ", in the popup window, select the first item" merge a range of revision ", this type of merge has been introduced very clearly, applicable to a branch or the main line to submit the changes between the multiple revision to merge on another branch.

After clicking Next, the following window appears:

Because it is to be merged from the trunk to branch, it is natural that the "URL to merge from" should be the path of the trunk, "Revision range to merge" very well understood, Is that you want to merge which revision of the trunk into the branch, which can be a series of revision, such as 4-7,15-head, or a separate revision number. Because the trunk modifies the talk () method in the R4, the revision in the Person.java can only be filled in 4. Click Next to appear:

Just leave the default settings here. Before you click the merge button, you can test the merge to see if it's successful or not, and the details of the merge. When you click the Merge button, the trunk changes are synced to branch.

10, after the submission of the combined 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 merge branch back to the trunk, of course, if the branch to continue to develop, Then you will continue to repeat the 6-10 steps.

11. Merge branch back to Trunk

Right-click on the/trunk/myproject (note Right-click on the main Line's directory), select "TortoiseSVN", then "Merge ...", and in the popup window, merge type Select the second item "reintegrate a branch" , this type of merge is suitable for merging all changes back to the mainline after the branch development is complete.

After clicking Next, the following window appears:

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

12. Submit the merged trunk

Right-click on the merged item, TEMP---Commit.

13. Delete Branch

If you think your new add-on 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'll find out what we did by log:

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

The gray is the log associated with the merge, a total of two times the merge, the first time in R6, in R6, branch merge the trunk in the R4 when the changes submitted; the second is in R7, where the trunk incorporates all the changes R7 from branch to R2.

SVN branch Development and Trunk Merge (branch & merge)

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.