Document directory
- Delete, move, and rename an object
- Submission time
When programmers write programs, each program has many different versions. This requires programmers to manage the code well and obtain the required versions at the required time, each version has a complete description.
Use Subversion (SVN for short) as a version management tool. When multiple programmers manage the same piece of code, version management is particularly important. SVN can be used to conveniently branch and merge and record all versions.
Divide the version into the main line trunk
And branch and tag.The cleanest version of the main line is a stable version running online. After a new function is developed from the main line, it is developed on the branch. After the development is completed and the test is passed, it is submitted to the main line. The main function of Tag is to quickly roll back to a stable time point.
Strictly control the number of branch,PersistenceTrunkStable versionAfter branch is developed and launched, merge returns to trunk and branch is eliminated. There is a conflict resolution mechanism. The conflicting parties should carefully check and final the version. Branch
Dedicated personnel are responsible for merge to trunk to avoid submitting incorrect changes to trunk.
After Trunk is stable,
Make a tag when going online.
After Trunk is launched,
It may be unsatisfactory. You may need to roll back to a previous version.
In this case, you can roll back to the tag created in the previous launch.
TrunkAnd tagResponsible by a dedicated person,
Developers can only go to branchSubmitting code,
TrunkAnd tagDevelopers only have read permission.
Basic Version Control Process:
1)
Each development team establishes its own branch and develops it on this branch.
2)
Various development teams merge branches on the trunk and form a relatively stable
3)
Each group creates a new branch from the main line and develops the branch (that is, return to the first step)
4)
It repeats until the end of the project.
Project implementation version control is divided into four steps:
1)
Development version develop. If several groups develop at the same time, multiple branches can be split.
2)
Alpha of the beta version. After development, convert it to alpha for internal testing.
3)
Beta is a public beta version. After the internal test is passed, the beta version is converted to a public beta version.
4)
Production of the released version. After all tests are passed, the product is converted to the production version and merged to the main line.
SVN repository Layout
A version library contains multiple projects, which are usually arranged by branch:
/Trunk/project1
/Trunk/project2
/Branches/project1
/Branches/project2
/Tags/project1
/Tags/project2
Or by project:
/Project1/trunk
/Project1/branches
/Project1/tags
/Project2/trunk
/Project2/branches
/Project2/tags
If the project is not closely related and each one is checked out separately, it is reasonable to layout it by project. For projects that you want to check out all projects at a time or need to pack them into a distribution package, it is usually better to layout by branch. In this way, you only need to check a branch and the relationship between sub-projects is clear.
Branch and tag
A feature of the version control system is the ability to separate various modifications and put them on a split line of development products. This line is calledBranch. Branches are often used to test new features without interfering with trunk lines. After the new features are stable enough, the branch of the development product canHybridBack to the main branch (Main Line ).
Another feature of the version control system is the ability to mark a special version (for example, a release version), so you can recreate a specific component and environment at any time. This process is calledMark.
Subversion does not have any special commands used to create branches and tags, but is replaced by the so-called cheap copy. Cheap
Copy is similar to a hard connection in Unix. It means to create an internal connection instead of a full copy in a version library, pointing to a specific version tree. Result branches and tags are created quickly and
And does not occupy any additional space in the version library.
Merge
When the program reaches a relatively stable stage, it needs to merge the branches to the trunk. The following describes the merge process.
1) Term1 splits branch (term1_090420) and Term2 from trunk
Split branch from trunk
(Term2_090420)
2)
Term1 and Term2 respectively modify the code on their own branch.
3) Term1 first checks out the trunk to the local device. Right-click the main directory and choose Term> merge. The following window is displayed:
This dialog box combines the differences between the branch version specified by From and the branch version specified by To into the trunk.
Here, the Branch is term1_090420.
Then click merge to merge. You can also use the dry
Run to see if there is a difference between the two. Since no one else modified the trunk, the merge was smooth. After the merge was completed, xb submitted the trunk.
4) Merge the term2_090420 branches to the trunk to resolve the conflict.
After the Term1 merge is completed, Term2 will merge its branches to the trunk. The method is the same as above. However, because Term1 has modified the trunk, a conflict dialog box is displayed. Double-click the conflicting file name in the dialog box to bring up the tool to merge the file.
Delete, move, and rename files
You can rename, move, or delete your files or folders, but use SVN to perform these operations, otherwise the previous version information will be lost.
Before you delete, move, or rename an object, make sure that the working directory is the latest version. After you perform these operations, submit the file.
Submission time
Each project has many small modules. When a module is stable, you need to submit it once to avoid unrecoverable errors when writing a module code.
Before each submission, you must use the Java compilation check to ensure that a compilation version is correct. When you submit a stable version, you must modify the version number.
Add comments when submitting the statement. If multiple users modify the same code, add more detailed descriptions for the comments.