Use Visual Studio Team Explorer to manage project source code

Use Visual Studio Team Explorer to manage project source code

    Recently participated in a WP7 open source project initiated by WPMind webmaster Zhang Xin , which used Visual Studio Team Explorer for source code management. The following are some instructions for using Visual Studio Team Explorer to manage the source code on Codeplex, thanks to Zhang Xin for the material.

1. Set up     CodePlex to support three methods: Subversion, Visual Studio Team Explorer and Team Explorer Everywhere. Please go to the source code option page of the project and click the method you selected in the "Source Control Setup" section on the right to view the specific parameter information. The following steps take Visual Studio Team Explorer as an example. Open Team Explorer in Visual Studio (if not, please install it yourself), and select "Connect To Team Project" in Team Explorer. If your Team Explorer has not configured the project on CodePlex, please add Server, the parameters refer to the following figure or the prompt on Codeplex :

    Select TFS05 for Project Collection and wpmind as Project Name. It should be noted here that if your codeplex user name is zhangsan, then your user name in the source code management is snd\zhangsan_cp, and the password is the same as your codeplex password.

2. Source code acquisition     When Team Explorer connects to the wpmind project, you will see the following figure in Team Explorer:

    Please double-click "Source Control" to open "Source Control Explorer". Then select the wpmind project in the project list on the left, and then click "Not mapped" in the "Local Path" area at the top of the list on the right to set a local mapping directory for the project. Then right-click the item and select "Get Last Version" to get all the latest checked-in codes.

3. Check out and modify the code     Open the solution file (WPMind Framework for WP7.sln) obtained in step 2, and then right-click on any file in Solution Explorer and select "Check Out for Edit..." to get the file Check out for modification. Usually, you first need to check out the project file (WPMind.WP7.csproj) to add new files to the project.

4. Shelve your code     Shelve means shelving, when you modify/add some code, please do not check in directly to the server. You should let other members of the team conduct a code review, and only when 80% of the members agree to check in your code can the code be checked into the server. In this way, high-quality code can be guaranteed on the server. After modifying the code, right-click the project in the Solution Explorer and select "Shelve Pending Changes...". Then give your code a name of "Shelve" and add some comments, and finally click "Shelve" to submit the code to the server "Shelved" it.

5. Unshelve and code review     When someone Shelve coded, you need to post in the corresponding section of the forum to ask everyone to review the code. When reviewing the code, you need to open the project, and then in the VS2010 menu, in turn, "File" -> "Source Control" -> "Unshelve Pending Changes...". Then enter the ID of the member in the owner name (don't forget the _cp) and click Find to list all his pending codes.

    At this time, there are two ways to review. For small changes, please click the "Details" button, and all the codes in the Shelve will be listed:

    Select a certain file, right-click and then "Compare"->"With Last Version..." to compare this change with the final code on the server. Or you can also select the shelf in the previous shelf list, and then click "unshelve", the system will check out the corresponding files in your local area, and then apply these changes to your local area. Then you can compile and test it.

6. Abandon the modification     Sometimes you want to abandon some changes, or you need to abandon the local changes of these codes after viewing the codes of other people's shelves. Right-click on the project in Solution Explorer and select "Undo Pending changes" to discard all changes. And restore your local code to the final version checked in in the system.

7. Check in the code After the     code is approved, it is decided to check in. Right-click the project in Solution Explorer and select "Check In", then select the file to be checked in and add comments to submit.

Reference: Use Visual Studio Team Explorer to manage project source code-Cloud + Community-Tencent Cloud