Trunk, Branch (branch), tag (tag)

Source: Internet
Author: User

In the case of SVN, Git's master is equivalent to the Trunk,dev branch equivalent to branches

--------------------------------------------------------------------------------------------------------------- -----------------------------

Trunk: is used to master the direction of development has been moving forward, a new module development, this time on the trunk, when the module development completed, need to modify, with branch.

Branch: It is used for parallel development, where parallelism refers to the comparison with the trunk.

Tag: is used to make a milestone (milestone), whether it is a release version, but is a usable version, do not need to modify if you want to modify a tag for branche development.

--------------------------------------------------------------------------------------------------------------- -----------------------------

Why do you want to divide 3 directories? and are duplicates of code copy meaningful? Take a look at the following example to see the benefits of doing so.

For example: the development of a chat software QQ, the first period only requires the software has basic chat function, later will join the video chat, magic expression, change skin and other functions.

After the first phase of the development, tested by the test personnel no problem. This should be given the current code base tag named Qq_tag_release_ v1.0.0, at the same time trunk in full swing into the v2.0.0 development, but at this time by the majority of user feedback v1.0.0 QQ login often flash back, because v2.0.0 is developing even if the bug changed also can not release. Then you should make a branch (branch) named Qq_branch_bugfix_ based on the qq_tag_release_v1.0.0 tag (tag) v1.0.0 and based on this branch to quickly make bug changes, until the end of the bug modified to do a tag named qq_tag_release_v1.0.1, according to the need to decide qq_branch_bugfix_ v1.0.0 whether the merge (merge) is incorporated into the backbone (trunk).

--------------------------------------------------------------------------------------------------------------- -----------------------------

Steps:

1, New SVN warehouse single project/multi-project warehouse can be, structure like this

2. New Resource Library

Fill in the URL warehouse address click "Finish"

As follows

New QQ Project Import SVN trun directory (select project Right Team-->share Projects ... )

After importing the project, the SVN repository is as follows

Due to the intense work v1.0.0 finally developed (v1.0.0 only basic chat function), the test did not find that the problem can be provided to users, while playing a tag version of this code base named qq_tag_release_v1.0.0

Select the project right-click Team--> Branch/Tag ... "Fill in the version number to hit tag and click" Next "

Next "Next"

Click "Finish" after filling in the comments

At this time, the SVN repository tag directory will be more than a qq_tag_release_v1.0.0

At the same time trunk in full swing into the v2.0.0 development, video chat function is being developed

Check out the SVN repository at this point.

At this time by the majority of user feedback v1.0.0 QQ login often flash back, because v2.0.0 is developing even if the bug is not released. Then you should make a branch (branch) named qq_branch_bugfix_v1.0.0 based on the qq_tag_release_v1.0.0 tag (tag)

Select Project Right-click "Team"--"toggle (S ...)" To select the qq_tag_release_v1.0.0 of tags

Click "OK" after changing the path

qq_tag_release_v1.0.0 that have been switched to the tag

The next step is to create a branch named qq_branch_bugfix_v1.0.0 based on the qq_tag_release_v1.0.0 and quickly make bug changes on this branch.

Select the project right-click Team--> Branch/Tag ... "Click" To browse ... " Select Branches Directory

Fill in to create branch (branch) named "qq_branch_bugfix_v1.0.0" and click "Next"

Click "Next"

After completing the comments, select "Switch working copy to new branch/tag" and click "Finish".

Look at the changes in the workspace and the SVN repository

To modify a bug in the branch branch named "qq_branch_bugfix_v1.0.0"

Submit the code after modifying the bug

After submission

Flash back bug has been modified can be provided to the user, the next one to hit a tag named "qq_tag_release_v1.0.1"

Select the branch item named "qq_branch_bugfix_v1.0.0" right-click "team--> Branch/Tag ... "Click" To browse ... " Select Tags Directory

Fill in to create tag (tag) named "qq_tag_release_v1.0.1" and click "Next"

Click "Next"

Click "Finish" after filling in the comment information

To see what's changed in the repository, there's a tag named "qq_tag_release_v1.0.1" in the tags directory.

--------------------------------------------------------------------------------------------------------------- -----------------------------

The following demo merges the branch (branches) into the trunk (trunk)

The branch merge (merge) with the branch name "qq_branch_bugfix_v1.0.0" is merged into the trunk (trunk) as needed.

Steps

1. To merge branches into the trunk, you first need to switch to the trunk.
Right-click on the item, select team-Switch, URL address for trunk access path

(Skip ... above)

2. Right-click on the item and select "Team"--"merge (M) ..." and select "Reinitegrate a branch".

3. Select the branch "qq_branch_bugfix_v1.0.0" to be merged into the trunk

4. Click "Finish" to end the merge

5. Click "OK"

6. If you want to undo the merge selected item right-click "Undo merge ..."

7. In the trunk of the QQ project will be more from the branch "qq_branch_bugfix_v1.0.0" merge merged code

8. Submit the merged code

9. After submission as follows

--------------------------------------------------------------------------------------------------------------- -----------------------------

In general, all of our development is based on trunk development, when a version of/release development (development, testing, documentation, production installer, packaging, etc.) after the end of the code is frozen (artificially defined, can be managed by hooks). This should be based on the currently frozen code base, tag. When the next release/stage development task begins, the development of the trunk continues.
At this point, if you find some bugs in the previous released version (Releasedversion), or some very urgent feature requirements, and the version you are developing (developingversion) does not meet the time requirements, you need to modify it on the previous version. The corresponding branch (branch) should be developed based on the corresponding tag of the release version.

Trunk, Branch (branch), tag (tag)

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.