[SVN] linux command--SVN branch creation, merging

Source: Internet
Author: User

first, create a branch
1, create a branch
SVN copy svn://xx.com/repo/trunk svn://xx.com/repo/branches/try-something-m ' Make branches try-something '

2. Move the working directory to the branch
SVN switch svn://xx.com/repo/branches/try-something

Of course, you can also go back to the trunk svn switch svn://xx.com/repo/trunk



Merge a branch into the trunk
1, find the branch version
Method One: CD branch
SVN log--stop-on-copy
The last r11340 is the reversion when the branch is created

Method Two: CD trunk
Command: svn-q--stop-on-copy branch URL, this command queries all the changes from the branch after the branch was created, and the bottom version number is the version number we're looking for.
Example: SVN log-q--stop-on-copy svn://192.168.1.177/tags/beta_2009_12_24

2, merging into the trunk
Command: Svn-r Branch version number: The URL of the HEAD branch
Explanation: Head is the latest version on the current trunk
Example:
CD Trunk
SVN merge-r 12:head svn://192.168.1.177/tags/beta_2009_12_24


Resolve Conflicts:
Using SVN St | grep ^c Find conflicting files when merging, manually resolve conflicts
Use SVN resolved filename to tell SVN that the conflict has been resolved
Use SVN commit-m "" to prompt the merged version


Svn:aborting commit: '/path/resources/noc ' remains in conflict
$ svn revert Resources/noc
Reverted ' Resources/noc '


Three, two branches merge

Two branch merges can be split into two steps:

The first step:

197 from the old trunk,
186 after the tag, that is the new trunk

Merging the latest code means that the new trunk is compared to the old trunk and added to 197. So 197 has its own new code, but also the latest code on the line.
CD 197_branch
SVN merge Https://xxx.com/tags/project/project_Old_BL Https://xxx.com/tags/project/project_New_BL
SVN ci-m ' Merge 186 trunk '





Step Two:

But then, others to 186 code, so also need to 186 branch (that is, after the tag 186, hit the tag before the 186 is the backbone) merged into 197.
Merge method: Find the difference between the 186 branches, the alignment and the new trunk, and add to the 197. So 197 has the latest all the code.
CD 197_branch
SVN merge Https://xxx.com/tags/project/project_New_BL Https:/xxx.com/project/branches/project/186_branch
SVN ci-m ' Merge 186 branch '




Iv. Release

Tag the current trunk, and this tag is no longer changed, but actually the label and the branch is a meaning, you can continue to make changes on the label, but this is not recommended.
SVN copy svn://xx.com/repo/trunk svn://xx.com/repo/tags/rb-1.0

[SVN] linux command--SVN branch creation, merging

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.