Source Control Using visualsvn server and tortoisesvn]

Source: Internet
Author: User
Tags svn client svn update tortoisesvn
Source Control Using visualsvn server and tortoisesvn]

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 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!

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.