Examples of branches branches and merge applications in SVN

Source: Internet
Author: User
Tags svn update

Come from:http://www.360doc.com/content/12/0816/19/1317564_230547958.shtml

Create a branch branch or tag tag
It is easy to create a branch and tag when the repository is created according to the recommended structure.
A repository test was created on my SVN server with the following structure:


In my local checkout checkout, add a file Test.txt and then commit.

Join this time we need to publish a version of the file, while there may be other people will be modified,

But we cannot affect the current file, only after it has been modified and then merged, in which case we create a branch.



This time we can find the URL of the SVN property of the local trunk folder has been switch to the address of the created version:

To perform the SVN update command, you can see the new folder under the Local Branches folder v1.0 and the file v1.0 inside the folder.

modifying branches and using the merge merge feature

Modify branches/v1.0 The following file Test.txt, add a line modified in branch v1.0. Then check in to the SVN server:

Since we have just converted the SVN repository URL of the trunk to the corresponding version, we can see the updated Test.txt file at this time by updating the trunk folder.
For testing purposes, we switch the trunk folder to the corresponding trunk address:

When switch succeeds, we can see that the contents of the Test.txt file under the trunk are not changed, which is a reflection of what we have just said about the changes in the branch without affecting the trunk.
Modify the Test.txt under the Trunk folder below to add a line modified in trunk. Then check in to the SVN server:

It is best to implement an important feature, merge merge, merging branches into the trunk, which is a feature we often use in team software development.
In TortoiseSVN's revision graph, you can view the version change diagram of the trunk as follows:

It can be concluded that in version 10 we created the branch version/branches/v1.0, and the SVN version is 11, on the basis of version 11 we have modified the branch and then we have version 12, and then we modify the trunk file under the version 13, The current version of SVN is 13, which is consistent with the changes we have just made.
The following merges the branch v1.0 into the trunk.
According to our current situation, choose the second type:

Select v1.0:

Then, as follows:

The problem will certainly arise in our merger, as we have made two changes to the Test.txt file, which will result in conflicting conflict, but this should not be the case in practice, since the branch is created to modify files that are not modified in the trunk. So that the modifications are completed and merged into the trunk. But it doesn't matter, we're only here to demonstrate, so just deal with the conflict, manually merge it (which in practice should not otherwise have lost the use of the branch):

This time you can see that our Test.txt file has been implemented as I have just manually handled the conflict:

Then check in the trunk into the repository:

If we look at the Test.txt file under branches\v1.0, it's still content that was originally edited in the trunk.
Another point of emphasis: in the actual operation we will not be a branch file in the trunk of the changes, otherwise there will be some conflicts, so that the convenience of the branch is lost; tag creation and branching is the same as the class S, but tag is often used only to identify a specific version, but not for bug fixes, Add new features and more.

Examples of branches branches and merge applications in SVN

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.