TortoiseSVN is a version control software client. It is much simpler to implement the main SVN functions with the VisualSVN Server than to use the original SVN and Apache to implement SVN management of source code. VisualSVN-Server This software directly helps complete many configurations, such as adding services, etc. It is relatively easy to use and easy to use, while Subversion requires someone to configure some things. I personally feel that using the first software can fully meet the requirements;
[TortoiseSVN server side] How to use:
After installing VisualSVN Server [see the installation process here], run VisualSVN Server Manger. The following is the startup interface:
Okay, let me add a code library [Repository], as shown below:
Create a new code library as shown in the picture above, and enter the code library name in the text box as shown below:
Note: If CheckBox in the above picture is selected, three subdirectories such as trunk, branches, and tags will be created under the code base StartKit; if not selected, only an empty code base StartKit will be created.
Click the OK button and the code library is created successfully.
After creating the code base, there is nothing in it. I'll explain how to import the source code in the second part of this tutorial.
Next, we start the security settings, right-click on Users on the left:
Enter the above information, click OK, and we will create a user. Follow the above process and add users Developer1, tester1, and manager1 respectively. Okay, let's start adding these users to the project we just created:
Click the "Add..." button in the picture above, select the user we just added in the picture below, and click the OK button:
Note: You may have noticed Groups in the picture below. Yes, you can also create groups first, add users to each group, and then authorize the group. The operation is relatively simple, so skip it here.
Authorize users [or groups] respectively as shown in the figure below:
Click the "OK" button, and the above user will have different permissions to access the StartKit code base.
Because user starter is a newcomer in the team and is not expected to submit new code to the code base, he can only read the code in the code base and cannot submit code. tester1 is a tester and is not responsible for code writing, so it also has read-only permissions. Developer1 and manager1 are developers and project managers, and naturally have read and write permissions.
In the actual project development process, it is often impossible to have only one developer and tester. At this time, it is more convenient to use groups for authorization. You can practice this by yourself.
Basic usage of TotoiseSVN
In Project Management Practice Tutorial 1, If you want to do your job well, you must first sharpen your tools [Basic Tools], I have already explained how to install TortoiseSVN. In the above explanation, I have already talked about how to use VisualSVN Server. Today I want to talk about the simple use of TortoiseSVN.
1. Check in the source code to the SVN server
If we use Visual Studio to create a project in the folder StartKit, we need to check the source code of this project into the code library on the SVN Server. First, right-click the StartKit folder. The right-click menu is as shown below. :
Figure 2-2-1
Click Import, and the following form will pop up, where http://zt.net.henu.edu.cn is the server name, svn is the root directory of the code warehouse, and StartKit is a code library we added in the previous tutorial:
Note: The CheckBox in the lower left corner is useless when checking in the source code for the first time, but it is very useful when you submit the code in the future.
Figure 2-2-2
Click the OK button, and the following form will pop up, asking for credentials:
Figure 2-2-3
Enter the username and password in the form above and click the OK button:
Figure 2-2-4
As shown in the picture above, well, the source code has been successfully checked into the SVN server. At this time, team members can migrate the source code on the SVN server to their own machines.
2. Check out the source code to your local machine
Create the folder StartKit on this machine, right-click Checkout, and the following form will pop up:
Figure 2-2-5
In the above picture, enter the address of the code library in the svn server in the text box under URL of Repository:, and other defaults. Click the OK button to start checking out the source code.
Note: The Checkout Depth in the picture above has 4 options, namely, move out all, check out only lower-level subdirectories and files, only check out files, and only check out empty projects. The default is the first option. In the above example, we can also use the web to access the code library and enter http://zt.net.henu.edu.cn/svn/StartKit/ in the browser
At this time, a dialog box will pop up, requiring you to enter your username and password. After verification, you can browse the content in the code base.
Done! The source code has been successfully checked out to the newly created StartKit directory.
Open the StartKit directory and you can see the folder structure as shown below:
Figure 2-2-5
Once you make any modifications to a file or folder, the display image of the file or folder may change. In the picture below I modified two of the files:
Figure 2-2-7
Let’s take a look at the pictures corresponding to different states:
Figure 2-2-8
We already know how to check in the source code to the SVN server, how to check out the code from the server to the local machine, and also briefly understand the patterns corresponding to different states.
3. Submit the modified files to the SVN server
In Figure 2-2-7 above, I modified the two files ImageInfo.cs and NewsInfo.cs located in the Model file. The following demonstrates how to submit them to the SVN server.
Note: When submitting source code to the server, be sure to ensure that the local code is the latest version, otherwise the submission may fail or cause a version conflict.
Right-click on the Model folder or right-click on the blank space under the Model file, and click SVN Commit... The following form will pop up:
Figure 2-2-9
After clicking the OK button, the form as shown below pops up:
Figure 2-2-10
4. Add new files to the SVN server
We add a new class file UserInfo.cs under the Model file, right-click in the blank space under the Model file, click SVN Commit..., and submit the modified file to the SVN server as mentioned above, and that's it.
In addition, you can also right-click on the file UserInfo.cs and click TortoiseSVN=>>Add to pop up the form as shown below:
Figure 2-2-11
Select the UserInfo.cs file and click the OK button. This does not submit the file to the SVN server. It just marks the file as a file in the source code library and sets its status to modified status. After that, we need to SVN Commit this file again before we can actually submit it to the code base on the SVN server.
The above is about adding files. In fact, the steps for adding folders are the same, so I won’t go into them here.