preface

In my work, I have been updating and committing on the SVN client. Other SVN operations, such as branch, merge, Tag, etc., are usually the responsibility of the development boss, and I always do not have a thorough understanding of them. These are the core of version management, and version management is very necessary to master as part of development. The best way to learn is to set up a SVN server and test it.

Install the TortoiseSVN client. 2. Install the Visual SVN Server and create a code repository to test the SVN

Configure the Visual SVN Server

  1. Modelled on http://www.jianshu.com/p/fc8443a9aafe code repo24 warehouse, two folders inside the trunk and branch. Configure username and password (assigned to each development), group (no effect yet)

  1. Create empty folders dml_trunk locally, as well as direct checkout, the address with the trunk has just set up warehouse: http://dev-dengml.luban.com/svn/repo24/trunk

  2. In dML_trunk I created an Android project, then add, then commit, and look at SVN Server: the code was successfully committed

Code the rollback

For example, I now want to roll back to the new project:

Set up the Tag

Function: Back up the code for each official release such as 1.0, 1.2, and 2.0, so that you can directly obtain the source code of a certain version in the future. The read-only attribute is mainly set on the SVN server

  1. Trunk1.0: Create branch/tag this reversion Select the path on the SVN Server. In this case, I create a new 1.0 under Branch and select Head Revision in the Repository

Establish branch

Reference: http://blog.jobbole.com/106868/

Function: For example, if the 1.0 version has been released and the 1.2 project is being developed on the trunk, suddenly there is an urgent bug that needs to be fixed, then the 1.0 tag will come into play. Directly pull a branch 1.0_SP1, tell the SVN path to the developer, and change the bug on this branch and submit the release. This version is usually named 1.0.1 and is tagged again.

The procedure for creating a branch is the same as that for adding a tag, but the path is different, for example, branch/ 1.0_SP1. After that, the SVN server has three folders: three SVN paths

  • Trunk: Code trunk, under development 1.2
  • Branch /1.0: Version 1.0 of the tag, read-only
  • Branch / 1.0_SP1:1.0 branch, urgent bug change

Merge branches into trunk to resolve conflicts

If 1.0_SP1 is no longer needed, merge the code into trunk: go to the local trunk directory, right-click merge “Merge a range of versions”, fill in the branch path, other defaults, all the way to Next. Here I create a conflict: 1.0_SP1 and Trunk changed the same line of code in the same file setting. Gradle. Error: Merge error: