First, the basic concept
Trunk: Trunk (code that can be understood as a development environment, usually a working directory for development)
Branches: A copy of the code from the backbone back to the SVN server to build a branch directory (usually called Branch, generally in line with the production code to keep in sync)
Tag: Skeleton version tag (identifies each large upgrade version number)
II. Principles of Management
1, the system before the launch, there is only one trunk (trunk), all developers in the backbone of collaborative development.
2. After the system is on-line, create a branch on the base of the trunk, which is mainly used to fix the bug of the production environment, or the emergency new function is on line. The backbone is still being developed for new functional modules.
3, each production environment upgrade, all from the branch for packaging deployment. After the upgrade, you need to merge the changed code on the branch into the trunk in time ( developers often forget, remember).
4, the new function in the trunk of the development, need to make a big upgrade, you can first hit the trunk tag as a large version, and at the same time create a corresponding branch, and then switch to the branch for packaging deployment, this version of the Production Code maintenance is also on the branch.
Principle: Branching is used for production code maintenance, the backbone is used for development, and tag is used for major version of the backbone.
Third, merger
The merger is divided into 2 categories according to the target:
1, branch consolidation to the backbone: mainly used in the repair of production bugs, and after the launch. You need to merge the changed code into the trunk.
2, Trunk Merge to branch: Common logical changes, need to be reflected on all parallel branches.
Note: The merge is to operate on the target directory, such as: branch merge to Trunk (trunk as the target), need to switch to the trunk operation merge function, the trunk merge to the branch (branch target), need to switch to the branch to operate.
The first option: Merge the specified version, either from the branch to the trunk or the trunk merge version, and the main effect is to merge part of the branch modification into the trunk.
Second option: Merge the changes on the trunk to the branch.
The third option: two different branch merges, but it can also be a merge of branches and Trunks, as long as the from selection is the main dry line.
Usually choose the first or the third item to do the operation, it is important to note that:
This is actually the difference between the to version and the from version, and merges the differences into the current version of to (head version).
Note: If you want to merge all the changes from the branch to the trunk, from the need to select the version number of the skeleton to be seen in the branch, to select the latest version of the branch (Head version) on the line.
If the from is also selected for the backbone head version, to also select the head version, the difference between all branches and the trunk will be overwritten to the current trunk. The file that caused the trunk is covered by a branch.
Example (branch merge to trunk):
Trunk Trunk:
https://192.168.0.11:8443/svn/code/product/trunk/Project Name/code/osgiserver/plugins/com.tzf.svn.test
Branch branches:
Https://192.168.0.11:8443/svn/code/product/branches/Project Name/code/osgiserver/plugins/com.tzf.svn.test
Download the Win32svn file from Http://subversion.apache.org/packages.html#windows first: setup-subversion-1.6.13. Install, under CMD, the SVN command is ready. There are two functions for downloading this: View the version of the branch and resolve the merge conflict.
object being manipulated: trunk
From : The version of the trunk when it is out of branch
To : head version of the branch (latest version)
OK, now switch the project to the trunk, as the main object is the backbone project as it is merged from branch to trunk.
To merge to know the version number when branching out, CMD opens the command line and uses SVN log--verbose--stop-on-copy "Branch_path" To view the version update information,
Find the latest version of the information, this is r8623, remember this version number, the future of the merged from IS from this version number. To refers to the version number you want to merge, usually the latest version, or a specific version of it.
Switch to trunk, select Project, right-click Team--Merge:
Next, appears (if not submitted to be submitted first)
From is the path of the branch, the following selection is the branch that just noted the version number, to here is the merge to that version, I choose the latest version. Click Finish, if there is a conflict in the file pop-up box, choose now temporarily do not handle the line.
I do not have a file conflict here, click OK is basically done. At this time need to check in the trunk of the document with modified symbols, complete the submission of the merger.
What if the file conflicts, enter the directory of the conflicting file under the command line, type with the SVN command-line client: SVN resolved the conflicting file name to remove the conflict.
Okay, this is a merge from branch to trunk. There are also two kinds of merging: from the trunk to the branch and from the branch to the branch, the operation is similar. Specific references are as follows:
Merging from trunk to branch
Imagine a project in which a subproject is created independently, requires a separate release, uses the underlying framework code, and the underlying framework is constantly modified in the trunk, which requires merging from the trunk to the branch.
manipulated object: Branch
From : The first version of a branch (oldest version)
To : head version of the trunk (latest version)
This is equivalent to starting from the first version of the branch until the last version of the trunk has finished merging, replacing the branch.
Merge from branch to branch
There is a requirement: There are many branches in a project, these branches need to be staged, there are multiple work in parallel, but each issue can not affect each other, this will be able to play a few tags (also branches) from the skeleton copy. The other trunks are merged into these tags according to the schedule. For example, PrjTag1 and Prjtag2,model1, Model2 need to be merged into PRJTAG1, MODEL3 and Model4 need to be merged into PrjTag2. Take PRJTAG1 Example:
In PrjTag1 's work copy, the merge
From : The version of the trunk when it is out of branch
To : head version of the branch (latest version)
Note: The From is not a version of this tag, but the previous trunk out of the branch when the version, the final merge to PrjTag1 work copy, and PRJTAG1 is unable to find the original score support version.
Iv. Branches
Requirement: Branches develop and cut a branch to tags
TORTORISESVN--->branch/tag, choose tags to store the path.
Project version Control