Team explorer tutorial 2

Source: Internet
Author: User

Previous Article: Team explorer tutorial 1

 

Note: The following uses the English version of vs2008 as an example. However, I try to describe it in Chinese (English. The title * below indicates that this part is operated by the Project Administrator. Other project participants do not need to perform this operation.

 

5. Check in Code

The so-called check-in code refers to modifying the code locally (including adding projects, adding files, modifying code, modifying solution settings, and other operations that change the controlled files) reflected on the server, so that other team members can immediately obtain the latestSource code.

Right-click the file, project, or solution to be checked in and choose check in. In the displayed check in dialog box, enter description (comment ), select the items to be checked in (all the modified items and types are listed here, not just the current project you opened .). In the work items section, you can set the work items that have been checked in here (for descriptions of work items, see the following section ). In the "check-in notes" section, you can set "code reviewer", "Security reviewer", "performance reviewer", and other information related to this check-in. Click "check in" to complete the check. Of course, it is possible that two people modify a file at the same time, which will cause code conflicts. This part will be introduced later. Now let's look at solution manager. We can see a small lock before each item, indicating that the item has been checked in ).

It is recommended that you obtain the latest version before checking in, and check in after ensuring normal compilation and running.

Figure 1: Right-click to select Check In

Figure 2: Check In dialog box 1

Figure 3: Check In dialog box 2

Figure 4: Check In dialog box 3

Figure 5

6. Obtain the source code

After adding this project to other participants of the project, you can obtain the project source code using the following methods. In "team resource manager", double-click "Source Control" to open "source control Explorer". The projects that the current user can participate in are listed here, black indicates that the project has been added to the team resource manager. Right-click the project or its subprojects and choose "Get latest version )", if you have not obtained the source code before (in essence, you have not created a workspace, so you will talk about it later), a dialog box will pop up to select the folder to save. You can download the project source code from the server to the selected folder. If you want to obtain a previous version, right-click it and choose get from the shortcut menu. In the get dialog box that appears, you can select a category in the version section, for example, for a specific date, Changeset, or the latest version, I will not talk about this part.

Figure 6: Double-click source control

Figure 7: Get the latest version

Figure 8: select the folder to save

Figure 9: Get a specific version

 

7. Manage a workspace

Workspace, well, this is not a good explanation. I think it is like a place where you work. You write code and manage code in this particular place. Well, you can understand it yourself. Okay, no explanation. Let's talk about how to operate it.

7. 1. Create a workspace

Menu File> source control> Workspace ...), The Manage workspace dialog box is displayed. The existing workspace is listed here. If it does not exist, click Add. Here, you can set the workspace name, logon User Name (owner), and computer name (computer ), description (comment) and working directory (working folder), click the button in the source control folder cell, select a project in the pop-up dialog box, and click the button in the local folder, in the pop-up folder, select the local code folder and click OK.

 

Figure 10

Figure 11: Manage a workspace

Figure 12: Add a workspace

. Edit Workspace

In the space dialog box (manage workspaces), select the workspace to be edited and double-click or click Edit to open the edit workspace dialog box. You can make some modifications here. Note that the working directory (working folders) contains a working directory (if it is in the same workspace) for each project you participate in. You can edit it, for example, to change the local directory,ProgramYou will be prompted whether to get the latest version, or you can remove this project. The window will also pop up whether to get the latest version. If you click yes, the files in the original folder will be gone.

7.3 delete a workspace

This part is not required.

 

8. Check out

Check out is like telling someone else that I want to change this file. You 'd better not change it, or there may be conflicts. If "allow multiple users to check out at the same time" is set, conflicts may occur. Of course, if there is no choice, someone else cannot check out after checking out. The specific settings are not discussed in this part.

The simplest way to check out is to double-click a file in Solution Explorer, and the first modification to it will trigger the check-out operation, this is the default setting. You can set this part in options. For more information, see team explorer tutorial 1. If Automatic check-out is not set, right-click and select "check out for edit now" to complete any operations. After the file is checked out, a red check mark is displayed in front of it.

A small profile picture will appear before a file or project that has been checked out by someone else.

Figure 13: Set check-in/Checkout rules

Figure 14: Select Check Out for edit now

Figure 15 files checked out by others

 

9. Lock

The purpose of locking is to prevent others from editing this file. Right-click the file you want to lock and select "Lock" to open the "Lock" dialog box, here, you can check which files are locked and the lock details. If you want to unlock the file, select unlock in the same way.

Figure 16: Select lock

Figure 17: Lock dialog box

10. Compare File Modification

A convenient and practical function provided by VFS is the comparison function. Through this function, you can know the difference between the current version and other versions (such as the latest version on the server, this function can also be used to resolve code conflicts. It's easy to use. Right-click the file you want to compare and select "Compare" to open the "Compare" dialog box. You can select the source file and target file, and click "OK" to open a window, the target file and source file (such as the file you modified) are displayed in two columns, and the modified part is highlighted in gray. There are two buttons on the top right to quickly jump between several modifications.

Figure 18: Select compare

Figure 19: Compare dialog box

Figure 20: Comparison window

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

11. Undo local modification

With this function, you can undo the modifications that have not been checked in to the server. Right-click the file or project to undo the modification, and select "undo pending changes ...", In the displayed dialog box, select the file to be undone and click "undo changes.

Figure 21: Select undo pending changes...

Figure 22: Undo pending changes dialog box

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.