Project Management Practice Tutorial II, source code control, Using visualsvn Server and TortoiseSVN

Source: Internet
Author: User
Tags svn svn client svn update tortoisesvn

In the first Article Project management Practice Course one, 工欲善其事, its prerequisite "Basic Tools" released, according to everyone's reply, I need to explain a few questions:

1. Why use the VisualSVN Server without subversion.

Reply:

Because if you use subversion directly, on a Windows system, if you want it to start with the system, you need to encapsulate SVN server as Windws service, and modify the configuration file to control user rights, and if you want to Web-mode HTTP protocol Access, and generally to install the configuration Apache, if it is a novice, it is not a headache. The VISUALSVN serve integrated subversion and Apache, eliminating all the hassle. When installed SVN server has been encapsulated as WINDWS Service,apache server configuration is only in the image interface, specify authentication mode, access port and other simple operations, in addition, user Rights management is also through the image interface to configure.

2. Why not use TFS?

Reply:

Because we started with subversion and TORTIOSESVN, we didn't have to change other software. As for TFS has not been used, in fact, I just read a few articles, I do not understand it.

3.VisualSVN Server is free of charge.

Reply:

Yes, VISUALSVN server is free, and VISUALSVN is charged. VISUALSVN is the SVN client, integrated with Visual Studio, VISUALSVN server is the SVN servers, including subversion, Apache, and user and rights management, and the advantages are already mentioned.

OK, let's get down to the beginning of our tutorial today.

I. Configuration and usage of VISUALSVN server "servers side"

After installing VISUALSVN server, "install process here", run VisualSVN Server manger, the following is the startup interface:

OK, let me add a code library "Repository", the following figure:

As shown in the above illustration, create a new code base and enter the name of the code library in the text box shown in the following illustration:

Note: If checked, the checkbox in the image above will create a trunk, branches, tags three subdirectory below the code base Startkit, and if unchecked, create an empty code base Startkit only.

Click the OK button, the code base is created successfully.

After creating the code base, nothing is inside. I'll explain how to move into the source code in the second part of this tutorial.

Now, let's start with the security settings and right click on the users on the left:

Enter the above information, click OK, we will create a user. According to the above procedure, add the user Developer1, Tester1, Manager1, OK, let's start adding these users to the project we just created:

Click on the "Add ..." button in the image above to select the user we just added in the image below and click the OK button:

Note: You may notice the groups in the following figure, yes, you can also create a group, add users to each group, and then authorize the group, the operation is relatively simple, in this skip.

Authorize the user "or group" as shown in the following illustration:

By clicking on the "OK" button, the user above has different permissions to access the Startkit code base.

Because the user starter is a newcomer in the team, and does not want him to submit new code to the code base, he can only read code in the code base and cannot submit code. Tester1 is a tester who is not responsible for code writing, so it is read-only. While Developer1 and Manager1 are developers and project managers, they naturally have read and write permissions.

In the actual project development process, developer and tester often cannot only one person, this time uses the group to authorize is more convenient, this everybody may own practice.

Second, the basic use method of TOTOISESVN

In the project management Practice tutorial, 工欲善其事, its prerequisite "Basic Tools", I have explained how to install TORTOISESVN. In the above explanation already talked about how to use VISUALSVN server, today I want to talk about, TortoiseSVN simple use method. One, check in source code to SVN server

If we use Visual Studio to create a project in the folder Startkit, we will check the source code of this project into the database on the SVN server, and first right-click the Startkit folder, the right menu is as shown in the following image:

Figure 2-2-1

Click Import to eject the form below, where http://zt.net.henu.edu.cn is the server name, and SVN is the root of the code warehouse, Startkit is a code library that we added in the last tutorial:

Note: The checkbox in the lower left corner is not useful when you first check in the source code, but it is very helpful when you submit the code later.

Figure 2-2-2

Clicking the OK button will pop up the form below and require credentials to be entered:

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 figure above, all right, the source code has been successfully checked into the SVN server. At this point, team members can move out of the SVN server source code to their own machine. Second, check out the source code to this machine

Create a folder on this machine Startkit, right click on Checkout, pop up the form of the following image:

Figure 2-2-5

Enter the address of the code base in SVN server in the text box below URL of Repository: Other defaults, click the OK button and start checking out the source code.

Note: The checkout Depth in the figure above, there are 4 options, is to move out all, only check out the next level of subdirectories and files, only check out the file, check out only empty items, the default is the first item. In the above example, we can also use the Web to access the Code library, in the browser input http://zt.net.henu.edu.cn/svn/StartKit/

It also pops up a dialog box that requires you to enter a username and password, and then you can browse the contents of the code base by verifying it.

Get. The source code has been successfully checked out to the Startkit directory that you just created.

Open the Startkit directory and you can see the folder structure of the following figure:

Figure 2-2-5

Once you have made any changes to the file or folder, the file or folder display picture opportunities change. I have modified two of these files in the following illustration:

Figure 2-2-7

Let's take a look at the picture of the different states:

Figure 2-2-8

We already know how to check the source code into the SVN server, how to check out the code from the server to the local, and simply understand the different state of the corresponding pattern. Third, submit modified files to SVN server

In Figure 2-2-7 above, I modified the two files ImageInfo.cs and NewsInfo.cs located in the model file, which shows how to submit to the SVN server.

Note: When submitting the source code to the server, make sure that the native code is the latest version, or else it may fail to commit or cause a version conflict.

In the Model folder on the right button or in the model file under the blank to right-click, click SVN Commit ... Eject the following form:

Figure 2-2-9

After clicking the OK button, pop up the form as shown below:

Figure 2-2-10

Iv. Add new files to SVN server

We add a new class file under the model file UserInfo.cs, click on the right button in the blank space under the model file, click SVN commit ..., as mentioned above to submit the modified file to the SVN server, it is OK.

Alternatively, you can right-click on the file UserInfo.cs, click Tortoisesvn=>>add, and pop up the form as follows:

Figure 2-2-11

Select the UserInfo.cs file and click the OK button so that the file is not submitted to the SVN server, just mark the file as a file in the source library and place it in the modified state. After that, we'll be able to commit this file again before we can actually commit it to the code base on the SVN server.

The above is to add a file, in fact, the steps to add a folder is the same, here is not said.

v. Update native code in line with the latest version on the SVN server

This is also very simple, as long as you need to update the folder on the right button or in the blank space under the file right click, click SVN Update, you can.

Note: The update operation may fail because of a version conflict, which can be resolved using merge or other methods, or it may fail because of locking "get lock", which requires unlocking "release lock" first. Six, rename the file or folder, and submit the modifications to the SVN server

Just right-click on the file or folder you want to rename, click Tortisesvn=>>rename ..., enter a new name in the form that pops up, and click the OK button. This method is also not a direct rename, but rather the name of the file or folder is marked as a renamed name, and we need to commit the SVN commit to the SVN server before we really rename it. Vii. Delete a file or folder and submit the modifications to the SVN server

The simplest is that you delete files or folders directly, and then use SVN commit to submit updates to the SVN server. Another way is to delete the file or folder you want to right-click =>>tortoisesvn=>>delete Delete, this method is not directly deleted, but the state of the file or folder to delete, also requires us to use SVN Commit commits to the SVN server before it is actually deleted.

Description: In fact, from the time you move the source code to the SVN server, each version of the data and files, even if you have deleted, can also be moved out.

The above is just tortoisesvn the simplest of several functions, in fact, his function is far more than these, other functions we can use in the process of slowly realize, some features I will be in the following tutorial to use, and then we will speak clearly use.

Note: When submitting the source code to the SVN server, do not submit folders such as Bin, obj, or else it will be troublesome. However, except for the bin directory of the Web project, DLLs generated by referencing other projects in the Bin directory of the Web project do not need to be committed.

A good habit: if the project references other third party assemblies, such as Enterpriselibrary, FCKeditor, and so on, do not simply refer to their installation location, but under your solution, add a library directory, Copy the required assembly here, and then quote from the Library directory, so what's the benefit, think about it yourself.

If you have any questions, in spite of the thread questions, I will answer in time.

Well, today is the first to write here, originally said this part of the preparation to write a blog, but now write so long, but also said a little very basic things, hehe ...

If you're unfamiliar with what I'm explaining, it's a good idea to look at this series of tutorials from the beginning: a series of tutorials on project management practice.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.