1. Configuration and usage of visual SVN server [server side]
After the visual SVN server is installed, run the following command to run the visual SVN Server:
Okay. Next I will add a code library [repository], right-click repository, and select create new repository.
Create a new code library and enter the code library name in the text box shown in.
Note: If the checkbox in is selected, the trunk, branches, and tags subdirectories will be created under the code base startkit. If not selected, only the empty code base startkit will be created.
Click OK to create the code library.
After creating the code library, there is no content in it. I will explain how to migrate the source code in the second part of this tutorial.
Next, let's start security settings, right-click users on the left:
Enter the above information and click OK to create a user. Follow the steps above to add users Example 1, tester1, and manager1 respectively. Now, let's start adding these users to the project we just created:
Click "add...", select the user we just added in, and click OK:
Note: You may have noticed groups. Yes, you can also create a group, add users to each group, and then authorize the group. The operation is relatively simple and skipped here.
Authorize the user or group as follows:
Click "OK". The above user has different permissions to access the startkit code base.
Because starter is a newcomer to the team and does not want him to submit new code to the code library, he can only read and replace the code in the code library and cannot submit the code. Tester1 is a tester and is not responsible for coding, so it is also a read-only permission. As developers and project managers, role 1 and manager1 naturally have the read and write permissions.
In the actual project development process, developers and tester often cannot have only one person. In this case, it is more convenient to use group authorization. You can practice it yourself.
Ii. Basic usage of toisesvn
In project management practice tutorial 1, to do a good job, you must first use the basic tools tool. I have explained how to install tortoisesvn. I have already explained how to use the visualsvn server in the above explanation. Today I want to talk about the simple usage of tortoisesvn.
I. 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 and then right-click the menu
Click Import to bring up the following form, where the http://zt.net.henu.edu.cn is the server name, SVN is the root directory of the code repository, startkit is a code library we added in the previous tutorial:
Note: the checkbox in the lower-left corner is useless when the source code is checked in for the first time. However, it is very useful when you submit code later.
Click "OK". The following form is displayed, requiring creden:
Enter the user name and password in the form, and click OK:
The source code has been successfully checked into the svn server. At this time, the team members can move the source code from the svn server to their machines.
Ii. Check out the source code to the Local Machine
Create a folder startkit on the local machine and right-click checkout.
In the figure, enter the address of the code library in SVN server in the URL of repository: text box. By default, click OK to check out the source code.
Note: The checkout depth in the figure has four options: Move out all, check out the sub-directories and files at the lower level, check out files only, and check out empty projects. The first option is selected by default. In the above example, we can also access the code library in the Web way, enter http://zt.net.henu.edu.cn/svn/StartKit/ in the browser
In this case, a dialog box is displayed, asking you to enter the user name and password. After verification, you can view the content in the code library.
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:
Once you have made any changes to the file or folder, the display image of the file or folder will change. I modified two of the files:
Let's take a look at the pictures corresponding to different States:
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 briefly understand the pattern corresponding to different States.
3. Submit the modified file to the svn Server
I modified the two imageinfo. CS and newsinfo. CS files in the model file. The following shows how to submit them to the svn server.
Note: When submitting the source code to the server, make sure that the local code is the latest version. Otherwise, the submission may fail or cause version conflict.
Right-click the model folder or right-click the blank area under the model file, and click SVN commit...
Click OK. the pop-up form is as follows:
4. Add new files to the svn Server
Add a new class file userinfo. CS under the model file, right-click the blank space under the model file, and click SVN commit ..., This is the same as submitting modified files to the svn server.
You can also right-click the file userinfo. CS and click tortoisesvn => Add
Select userinfo. CS file, click the OK button, so that the file is not submitted to the svn server, but the file is marked as a file in the source code library, and its status is changed. Then, we need to submit the svn commit file to the code library on the svn server.
The above is about adding files. In fact, the steps for adding folders are the same.
5. Update the local code to be consistent with the latest version on the svn server.
This is also very simple. You just need to right-click the folder to be updated or right-click the blank space under the file and click SVN update.
Note: The update operation may fail due to version conflict. You can use merge [merge] or another method to solve the problem. Alternatively, the update operation may fail because the get lock is locked, this is to unlock the [release lock] first ].
6. Rename the file or folder and submit the modification to the svn server.
Right-click the file or folder to be renamed, and click tortisesvn => & gt; rename ..., Enter a new name in the pop-up form and click OK. This method does not directly rename the file or folder, but marks the name of the file or folder as the name after renaming. We also need to submit it to the svn server using SVN commit to rename it.
7. delete files or folders and submit the changes to the svn server.
The easiest way is to directly delete files or folders and use SVN commit to submit updates to the svn server. Another method is to right-click the file or folder you want to delete> tortoisesvn => Delete to delete it. This method is not directly deleted, the state of the file or folder is set to delete. We also need to use SVN commit to submit it to the svn server before deleting it.
Note: In fact, from the time you migrate the source code to the svn server, data and files of each version can be moved out at any time even if you have deleted them.
The above are just the simplest functions of tortoisesvn. In fact, they are far more than these functions. You can learn about other functions in the process of using them, I will use some functions in the following tutorial. I will explain the usage in the future.
Note: When submitting source code to the svn server, do not submit folders such as bin and obj. Otherwise, it will be very troublesome. Except for the bin directory of the web project, the DLL generated by referencing other projects in the bin directory of the web project does not need to be submitted.
A good habit: if the project references other third-party assemblies, such as enterpriselibrary and FCKeditor, do not reference them from their installation location, but in your solution, add a library directory, copy the required assembly to it, and reference it from the library directory. What are the advantages of this!
Well, let's write it here today, but now it's so long, it's just a little basic stuff ......