How to use svn
Usage scenario:
If a certain part of your project (here refers to the mobile client project) The version (for example, version 1.0) has been developed, tested and has been launched online. Next, new requirements are received. The development of new requirements requires modifying the code in multiple files. When the requirements have been developed for a period of time, a sudden request is received. According to feedback from users or testers, there is a major bug in the project that needs to be fixed urgently, and it is required to go online immediately after the bug is fixed. How should the bug be fixed at this time? Is the repair based on the new needs that have been developed? The answer is no, and the reason is: If the bugs are fixed on the basis of new requirements that have been developed, then the new requirements have not been developed yet, let alone tested. How can it be put online immediately (or as quickly as possible)? ! Thirdly, what should I do if the development of new features and the code for bug fixing involve conflicts with the same piece of code. Obviously, bug fixing cannot be performed based on the currently developed code. The perfect solution is to perform bug fix in the version that was completed at that time. The benefits of this are:
1: After the bug is fixed It can be launched immediately, and the launch time will not be delayed because the new requirements have not been completed or tested.
2: Bug fixes are fixed in the version that was originally launched, and the risk of causing new bugs is small. If it is in the new Fix bugs based on requirements, then new features may bring new bugs
Related recommendations: "SVN Video Tutorial"
SVN warehouse directory structure Repository:
(1) trunk
(2) tags
(3) branches
trunk (trunk|main line) branches (branch) tags (mark)
truck (trunk|main line|main branch): It is used for main direction development. The development of new functions should be placed in the main line as a module. After development is completed, if modifications are needed, use branch.
branch (branch): Branch development and mainline development can be carried out at the same time, that is, parallel development. Branches are usually used to fix bugs.
tag (tag): used for tags An available version can be marked as a version that has been released online or as a version under testing. It is usually read-only.
SVN specific operation steps: (TortoiseSVN version: 1.8.8)
1: Create a warehouse
1. Create Directory structure D:\TortoiseSVN\Repository\Repo-iOS
2. Right-click on the directory structure
---> TortoiseSVN
---> Create repository here
---> Create folder structure (Create file structure) ---> Start Repobrowser (Start repository browsing) --- > Ok
FAQ"
3: Check Out 1. Create it anywhere on the computer A directory where the project code is stored, for example: D:\TortoiseSVN\Repository\Source2. Check out the code to this location- (void) viewDidLoad { [super viewDidLoad]; // ----------------------------------------- int y = 0; int result = 10 / y; NSLog(@"iOS APP 第一阶段开发完成了! 结果是:%ld", result); // End }
3. Create a new directory: 1.0 in the D:\TortoiseSVN\Repository\Source\tags directory, submit the directory to SVN, and then right-click the directory D:\TortoiseSVN\Repository\Source\trunk\MyAppProject ---> TortoiseSVN---->Branch/tag... -----> To Path :/tags/1.0/MyAppProject and select Head revision in repository ---> OkSource/ There is no content in the tags/1.0 directory. You need to update the directory for an update operation. After the update, you will see a complete project source code saved in this directory (the source code in this directory can be regarded as a copy of version 1.0 in the trunk directory). Check viewDidLoad and trunk/MyAppProject in /tags/1.0/HomeViewController. The viewDidLoad code in /HomeViewController is exactly the same.
4. Develop new requirements for the next stage, under development
5. Users or Testers report that the application has a major bug, which needs to be fixed immediately and put online as soon as possible. At this time, the programmer needs to create a branch for MyAppProject under tags/1.0.
The operation process is as follows: Select Source/ tags/1.0/MyAppProject Right-click TortoiseSVN---->Branch/tag... -----> To Path:/branches/MyAppProject ---> Ok
Look at D at this time: There is still no content in the \TortoiseSVN\Repository\Source\branches directory, and it needs to be updated. After the update, it is found that a complete project code also appears in the directory
(this code can be regarded as tags/1.0/ A copy of MyAppProject). Note that branching and tagging are done using the Branch/tag... menu. The difference is that the directory of To Path is different. For an illustration, see the diagram of branching. However, the value of to path is different. At this time, branches The viewDidLoad code in /MyAppProject/HomeViewController is exactly the same as the viewDidLoad code in tags/1.0/MyAppProject/HomeViewController.
6. Switch the workspace, use the Xcode|Eclipse integrated tool to open the project under /branches/MyAppProject, and then debug and fix the bug on this basis. Note that the project must be opened in the branch
7. After the bug is fixed, submit the modified file first and go online with the client App. After the online is completed, tag branches/MyAppProject/ to the 1.0.1 directory (tags/1.0.1) (The operation steps are the same as step 3). After the tag operation is completed, you can see that tags/1.0.1/HomeViewController.viewDidLoad and branches/MyAppProject/HomeViewController.viewDidLoad are completely consistent. It is convenient to add a new tag to branches/MyAppProject. Next time, we will fix the bug again on this basis. So far, the bug fix has been completed; the code after fixing the bug is as follows:
[objc] view plain copy
View the code piece on CODE Derived to my code piece
- (void) viewDidLoad { [super viewDidLoad]; // ----------------------------------------- int y = 10; int result = 10 / y; NSLog(@"iOS APP 第一阶段开发完成了! 结果是:%ld", result); // End NSLog(@"1.0 版本闪退bug 已修复, 程序出现除0异常"); }
8. Next, merge branch and trunk. The steps are as follows:
Right-click branches/MyAppProject ------>TortoiseSVN
----> Merge...
---> Merge a range of revisions
----> Next ---> URL to merge from : file:///D:/TortoiseSVN/Repository/Repo-iOS/trunk/MyAppProject
----> Next
- ---> Merge
- (void) viewDidLoad { [super viewDidLoad]; // ----------------------------------------- int y = <strong>10</strong>; // <strong>可以看到branches分支中的代码已经合并到主线上了</strong> int result = 10 / y; NSLog(@"iOS APP 第一阶段开发完成了! 结果是:%ld", result); // End NSLog(@"<strong>1.0 版本闪退bug 已修复, 程序出现除0异常</strong>"); NSLog(@"其他同事在主线trunk中进行新需求开发..."); NSLog(@"其他同事在主线trunk中进行新需求开发..."); }
##Instructions:
1. Branch development and trunk development are two completely independent processes, and both can be developed at the same time
2. Since branch and trunk development are in parallel, they can submit files modified by the current project as many times as they like
The above is the detailed content of How to use svn. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Version control is a very common operation in PHP development, and the most commonly used tool is SVN (Subversion). It can easily manage historical versions of code and code updates during collaborative development. The following will introduce how to use SVN for version control in PHP development. 1. Install the SVN client and server. First, you need to install the SVN client and server. The SVN client can download the corresponding version from the SVN official website and install it, while the server needs to be built by yourself. The specific method can be

Introduction to SVN SVN (Subversion) is a centralized version control system used to manage and maintain code bases. It allows multiple developers to collaborate on code development simultaneously and provides a complete record of historical modifications to the code. By using SVN, developers can: Ensure code stability and avoid code loss and damage. Track code modification history and easily roll back to previous versions. Collaborative development, multiple developers modify the code at the same time without conflict. Basic SVN Operations To use SVN, you need to install an SVN client, such as TortoiseSVN or SublimeMerge. Then you can follow these steps to perform basic operations: 1. Create the code base svnmkdirHttp://exampl

Detailed explanation of how to install and set up the EclipseSVN plug-in Eclipse is a widely used integrated development environment (IDE) that supports many different plug-ins to extend its functionality. One of them is the EclipseSVN plugin, which enables developers to interact with the Subversion version control system. This article will detail how to install and set up the EclipseSVN plug-in and provide specific code examples. Step 1: Install the EclipseSVN plug-in and open Eclipse

Differences: 1. vss was developed by Microsoft and is paid, while svn is open source and free; 2. vss must have a client, while svn can use the client, command line mode, or read-only on the web page Access; 3. vss only supports windows systems, while svn supports windows and linux systems; 4. vss is a "lock-edit-unlock" mode, and svn defaults to a "modify-conflict-merge" mode; 5. The version number of vss corresponds is a single file, and the version number of svn corresponds to the entire version library.

Installing SVN on CentOS is a very common operation. It is a powerful version control system that can be used to manage and track changes during software development. This article will introduce in detail how to install SVN on CentOS and provide some commonly used tools. Command line installation method. There are many ways to install SVN on CentOS. Two common installation methods will be introduced below. 1. Open the terminal and log in as the root user. 2. Run the following command to update the system package list: ```yumupdate3. Run the following command to install SVN: yuminstallsubversion4. After the installation is complete, you can verify whether SVN was successfully installed by running the following command: svn --v

Under Linux, it is very difficult to directly use the svndiff command to view code modifications, so I searched for a better solution on the Internet, which is to use vimdiff as a code viewing tool for svndiff, especially for those who are accustomed to using vim. It is very convenient. When using the svndiff command to compare the modifications of a certain file, for example, if you execute the following command: $svndiff-r4420ngx_http_limit_req_module.c, the following command will actually be sent to the default diff program: -u-Lngx_http_limit_req_module.c(revision4420)-Lngx_

As a Linux developer, you often need to use SVN to control project versions. For excellent developers, knowing how to check SVN versions is undoubtedly one of the essential skills. Today, I would like to take this opportunity to share my experience with you, hoping to help you better master this practical skill. 1. To install the SVN command line tool, please install the SVN command line tool in the Linux environment first! Please dial the terminal and then safely enter the following command to complete the installation: ```Dear user, please execute sudoapt-getinstallsubversion to install Subversion. 2. Connect to the SVN server After the installation is complete, we need to connect to the SVN server. Enter the following command:

As a commonly used server-side scripting language, PHP is widely used in the field of Web development due to its open source and cross-platform advantages. In the development of multi-person collaboration, version control is an indispensable tool. It can effectively manage the modification and update of source code and avoid conflicts caused by code out-of-synchronization among team members. As a popular version control tool, SVN is also widely used in PHP development. This article will introduce you to the basic knowledge of SVN version control in PHP development, including the installation of SVN.