1. Why does visual SVN Server not need Subversion?
Answer:
If you use Subversion directly, in Windows, to enable it to start with the system, you must encapsulate SVN Server as the windws service and modify the configuration file to control user permissions, in addition, if you want to access Apache through the Web [http protocol], you must install and configure Apache. If you are a newbie, isn't it a headache? While VisualSVN Serve integrates Subversion and Apache, saving all the above troubles. During installation, the SVN Server is encapsulated as the windws service, and the configuration of the Apache Server is only on the image interface, specifying authentication methods, access ports, and other simple operations. In addition, user permission management is also configured through the image interface.
2. Why not use TFS?
Answer:
Because Subversion and TortioseSVN were used at the beginning, no other software was changed. TFS has never been used yet. In fact, I only read some articles and I do not know about it.
3. Is the VisualSVN Server free of charge?
Answer:
Yes, visual SVN Server is free of charge, while visual SVN is charged. VisualSVN is the SVN client and integrated with Visual Studio. VisualSvn Server is the SVN Server, including Subversion, Apache, and user and permission management. The advantages have been mentioned above.
Now let's get down to the truth and start our tutorial today.
1. Configuration and usage of visual SVN Server [Server side]
After the visual SVN Server is installed, [here is the installation process] and run the visual SVN Server Manger. The following is the startup interface:
Okay. Next I will add a code library [Repository], for example:
Create a new code library as shown in, and enter the code library name in the text box shown in the following figure:
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 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, the right-click menu at this time is shown in:
Figure 2-2-1
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.
Figure 2-2-2
Click "OK". The following form is displayed, requiring creden:
Figure 2-2-3
In the above form, enter the user name and password, and click OK:
Figure 2-2-4
As shown in, 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
In the local machine, create the folder StartKit and right-click Checkout to bring up the following form:
Figure 2-2-5
In the text box at URL of Repository: Enter the address of the code library in svn server. By default, click OK to check out the source code.
Note: The Checkout Depth option in contains four options, namely, migrating out all, checking out only the sub-directories and files at the next level, checking out only files, and only checking out empty projects. The default option is the first item. 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 as shown in:
Figure 2-2-5
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 these 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 briefly understand the pattern corresponding to different States.
3. Submit the modified file to the SVN Server
In Figure 2-2-7 above, I modified the two ImageInfo. cs and NewsInfo. cs files in the Model file. The following shows how to submit the files 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... The following form is displayed:
Figure 2-2-9
Click OK to bring up the following form:
Figure 2-2-10
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.
In addition, you can right-click the file UserInfo. cs and click TortoiseSVN => Add to bring up the following form:
Figure 2-2-11
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 => 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 this directory, and then reference it from the Library directory. What are the advantages of this? Think about it for yourself!
If you have any questions, I will answer them as soon as possible.
Well, I 'd like to write it here today. I was going to write a Blog, but now I have written it so long, just to say something basic ......
If you are not familiar with the content I have explained, we recommend that you read this series of tutorials from the beginning: the Project Management Practices series.