Sie sind auf Seite 1von 41

Team Foundation Server User Guide

Whitepaper

Team Foundation Server User Guide White Paper

Author:

Naveen Kumar M (Naveen.Kumar48@wipro.com)

Reviewer: Mahesha Mahadevappa (Mahesha.Mahadevappa@wipro.com) Integration Solution Architect

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

Table of Contents Part 1 - Introduction and Overview ...............................................................................................................................4 Chapter 1: Introduction .............................................................................................................................................4 1.1 Overview .........................................................................................................................................................4 1.2 What is TFS? ....................................................................................................................................................4 1.3 Who is the Client of TFS? ................................................................................................................................4 Chapter 2: Architecture and System Requirements ..................................................................................................5 2.1 Architecture ....................................................................................................................................................5 2.2 Hardware Requirement ..................................................................................................................................7 2.3 System Requirement .......................................................................................................................................7 Part 2 Installing and Configuring Team Foundation Server ........................................................................................9 Chapter 3: Installation ...............................................................................................................................................9 3.1 Instilling Team Foundation Server ..................................................................................................................9 Chapter 4: Configuration .........................................................................................................................................12 4.1 Configuring Team Foundation Server ...........................................................................................................12 Part 3 Working with Team Foundation Server .........................................................................................................17 Chapter: 5 Connecting to TFS and adding Projects to TFS ......................................................................................17 5.1 How to connect to Team Foundation Server ................................................................................................17 5.2 How to add projects to source control .........................................................................................................20 5.3 How to check in the code to source control .................................................................................................22 5.4 How to check out the code from source control ..........................................................................................23 Chapter: 6 Basic Functionalities in TFS ....................................................................................................................25 6.1 How to apply label ........................................................................................................................................25 6.2 How to get latest version ..............................................................................................................................25 6.3 How to get Specific version ...........................................................................................................................26 6.4 How to View Pending Changes .....................................................................................................................29 6.5 How to lock ...................................................................................................................................................31 6.6. How to Shelve and Unshelve Pending Changes ...........................................................................................32 6.7 How to View History .....................................................................................................................................35 6.8 How to compare a code ................................................................................................................................35 6.9 How to get a code from TFS ..........................................................................................................................38 6.10 Binding or Unbinding a Project from Source control ..................................................................................40 References ...................................................................................................................................................................41

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

Amendment history for document


Revision No 1 Revision Date 27-09-2013 Author(s) Naveen kumar M Comments/Major Changes Initial Draft

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

Part 1 - Introduction and Overview Chapter 1: Introduction


1.1 Overview
With Visual Studio Team System (VSTS), Microsoft has made available an integrated set of tools which are used by members of the software development team. Each of them play one or multiple roles. One can very easily imagine roles of Business Analyst, Project Manager, Technology Solution Architect, Developer, tester and Release Manger. These roles use different tools which suit them. For example Developers over the years have used Visual Studio to create code and Project Managers use MS Project for creating, monitoring and controlling a project. All the tools used by various roles work on the same data which makes them integrated. These tools also need to access some services for managing the data. The data storage and the common services are provided by a server component of VSTS which is called Team Foundation Server. In this article we will take an overview, architecture, installation of Team Foundation Server and how to use it in projects with basic functionalities.

1.2 What is TFS?


TFS is not a code repository database. TFS is an Application Life Cycle Management (ALM) suite that allows team members, such as Project Managers, Business Analysts, System Analysts, Developers, Testers and even the client, to contribute to the project in a collaborative manner. TFS can integrate with many tools that are used on daily basis by the team, such as MS Project, Excel, SharePoint, Outlook, Word and others. TFS also provides a set of API to allow developers to write their own tools to integrate with TFS. As we can see, TFS is not only a source control repository but also provides a collection of tools to build a robust ALM suite to help whole team to collaborate and work together to deliver the product.

1.3 Who is the Client of TFS?


Visual Studio Source Control Outlook Alerts Teat Manager Tests

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

Build Work Items Reporting Eclipse Source Control Build Work Items Excel Reporting Work Items

Project Work Items Web Access Source Control(read) Work Items Reporting Share Point Reporting Documentation

SCVMM Lab Management TFS Admin Admin TFS Power Tools Admin

Chapter 2: Architecture and System Requirements


2.1 Architecture
2.1.1 Logical Architecture Team Foundation Server works in a multilayered server. It is divided in the layers of Data Layer and Application Layer. The client layer is used for creating and managing projects and accessing the items that are stored and managed for a project. The data layer and the application layer can be on the same machine if the number of clients is less than 20. Data layer is implemented in SQL Server 2005. When TFS is installed it creates number of database and tables for maintaining the data of the users, work items, source control and other resources. Being implemented on SQL Server 2005, data layer provides excellent scalability and performance. Application layer is implemented through set of services which are available over the network. Most of them are configured as web services which makes them possible to be accessed even over the Internet.

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

2.1.2 Physical Architecture It is possible to create single tier architecture for installations which do not demand high scalability. It is suggested that for any non-trivial installation the data layer and the application layer should be on different servers to meet the scalability and reliability requirements. For meeting the requirements of teams which are geographically scattered and connected through internet, TFS provides the ability to use proxy to fulfill the requirements of distant users. Although proxy will be caching the source code, main source control where changes are allowed to be stored is where the main installation of TFS is. It is also suggested to have a separate build server since the build activity is very highly CPU intensive. Keeping the main TFS and build server on same machine with frequent builds may hamper the performance of TFS adversely.

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

2.2 Hardware Requirement


The following lists hardware recommendations. Team Foundation Server minimum hardware requirements call for 1GB RAM and 8 GB of hard disk space for the basic configuration. 2.2 GHz or faster processor 1 GB RAM Basic installation 2 GB RAM Standard installation (no SharePoint) 10 GB RAM Full installations (includes SharePoint) 8 GB of available hard disk space

2.3 System Requirement


You can install Team Foundation Server on a server that is running one of the following operating systems: Windows 7 SP1 (x86 and x64) Windows 8 (x86 and x64) Windows Server 2008 SP2 (x64) Windows Server 2008 R2 SP1 (x64)

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

Windows Server 2012 (x64)

Team Foundation Server does not support the Server Core installation option for either Windows Server 2008 or Windows Server 2008 R2. If you are installing Team Foundation Server or SQL Server on Windows Server 2008 R2, you must have .NET Framework 3.5 installed. On Windows Server 2008 R2, you can install .NET Framework 3.5 by using the Add Features Wizard from Server Manager. If you are installing Team Foundation Server on Windows Server 2008 R2 or Windows 7, an issue with HTTP.sys may affect network connectivity.

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

Part 2 Installing and Configuring Team Foundation Server Chapter 3: Installation


3.1 Instilling Team Foundation Server
To install Team Foundation Server (TFS) 2010: 1. Download the TFS 2010 Beta 2 ISO image from the link mentioned. You can burn it to a DVD, mount it to a virtual drive using your favorite ISO management software or just extract the contents to your hard disk using a common tool like WinZip. Link: http://www.microsoft.com/en-us/download/default.aspx 2. Download the latest TFS 2010 Beta 2 Installation Guide from the link (Recommended for future reference). Link: http://www.microsoft.com/en-us/download/details.aspx?id=24337 3. Start the installation using setup.exe which you will find in the TFS-x64 and TFS-x86folder in the root of your installation media. Choose a folder depending on your computer architecture. 4. In the Welcome screen click Next.

Wipro Confidential

Date 27-08-2013

Team Foundation Server User Guide

Whitepaper

5. In the license terms screen click Next.

6. In the feature selection screen select the features you want to install and the install location. Then click Install and wait for the installation to complete.

Wipro Confidential 2013

10

Date 27-08-

Team Foundation Server User Guide

Whitepaper

7. In the final installation screen make sure the Launch Team Foundation Server Configuration Tool checkbox is checked and then click Finish.

Wipro Confidential 2013

11

Date 27-08-

Team Foundation Server User Guide

Whitepaper

Chapter 4: Configuration
4.1 Configuring Team Foundation Server
8. The Team Foundation Server Configuration Wizard will start now. Select Basic in the left panel of the wizard start screen and click Start Wizard.

Wipro Confidential 2013

12

Date 27-08-

Team Foundation Server User Guide

Whitepaper

9. In the TFS Basic Configuration Wizard start screen click Next.

10. In the SQL Server selection screen select SQL Server Express if you dont have any SQL Server instance installed on your machine. Otherwise that option will be disabled and you can choose your SQL Server instance. Then click Next.

Wipro Confidential 2013

13

Date 27-08-

Team Foundation Server User Guide

Whitepaper

11. In the Configuration Settings Summary screen click Next.

12. In the Readiness Checks screen wait until your proposed configuration passes all validations and then click Configure.

Wipro Confidential 2013

14

Date 27-08-

Team Foundation Server User Guide

Whitepaper

13. Wait until the wizard configures all required stuff and click Next.

14. Your TFS 2010 Beta 2 is now installed and configured. Click Close in the final screen to finish the configuration.

Wipro Confidential 2013

15

Date 27-08-

Team Foundation Server User Guide

Whitepaper

15. You can always check the details on your TFS configuration by going to the new Team Foundation Server Administration Console that you will find in Start Menu > Microsoft Team Foundation Server 2010 Beta 2. Some cool facts in this installation are: You no longer need a server OS for TFS. Your Windows 7 machine is just fine for the Basic configuration. The installation is now separated from the configuration. You install the bits once and can configure/reconfigure TFS many times in the future. This will allow you to change your configuration depending on your future environment needs without performing a full installation each time. The installation/configuration is very easy. You dont need to worry about having IIS installed and configured appropriately, and the same applies for SQL Server. The wizard will take care of everything to make sure you go from zero to a complete TFS installation with only a few clicks. You can now use SQL Server Express for your Basic configuration. The wizard will also install it if you dont have it. The Readiness Check is a huge time saving step. It will make sure your configuration will actually work before starting the configuration process. In previous versions you might need to wait until being in the middle of the installation process just to get an alert that tells you that you gave incorrect configuration data.

Wipro Confidential 2013

16

Date 27-08-

Team Foundation Server User Guide

Whitepaper

Part 3 Working with Team Foundation Server Chapter: 5 Connecting to TFS and adding Projects to TFS
5.1 How to connect to Team Foundation Server
1. Open Visual Studio go to Tools -> Options and check whether Visual Studio Team Foundation servers plug in was installed or not.

2. Click Tools, Connect to Team Foundation Server

Wipro Confidential 2013

17

Date 27-08-

Team Foundation Server User Guide

Whitepaper

3. Click Servers

4. Click Add

To correctly access TFS 2010, you are required to enter using the following syntax http://<servername>:<port>/tfs/<collectionname> Example: https://sww-swdw-team.shell.com/tfs/test

Wipro Confidential 2013

18

Date 27-08-

Team Foundation Server User Guide

Whitepaper

5. Enter the URL to your TFS 2010 server into the Add Team Foundation Server textbox

6. Click OK to add the server.

7. Click Close to return to the Connect screen.

Wipro Confidential 2013

19

Date 27-08-

Team Foundation Server User Guide

Whitepaper

8. Select your team project and click Connect.

5.2 How to add projects to source control


1. File -> Source Control -> Add Project to Source Control or right click on solution of your project need to be add in source control and select Add Project to Source Control option.

Wipro Confidential 2013

20

Date 27-08-

Team Foundation Server User Guide

Whitepaper

2. Select the respective folder in the TFS were you want to add you projects and click ok

3. There will be + symbol in front of the Project solutions, package s and whatever
items are in project.

Wipro Confidential 2013

21

Date 27-08-

Team Foundation Server User Guide

Whitepaper

5.3 How to check in the code to source control


4. To check in the code completely in Source Control Right click on your project solution and select check In

5. And give your comments in the comment text box and click Check In.

Wipro Confidential 2013

22

Date 27-08-

Team Foundation Server User Guide

Whitepaper

6. Once the code was added to Source Control, there will be lock symbol in the solution, package and other items in project.

5.4 How to check out the code from source control


7. Right click on the project solution and select Check Out for Edit option.

Wipro Confidential 2013

23

Date 27-08-

Team Foundation Server User Guide

Whitepaper

8. Select the lock type options None, Check Out or Check In and click Check Out.

9. Once the code was Checked Out from source control, you can see the tick mark in the project solution.

Wipro Confidential 2013

24

Date 27-08-

Team Foundation Server User Guide

Whitepaper

Chapter: 6 Basic Functionalities in TFS


6.1 How to apply label
1. To add a label to the project solution, open your project under source control. 2. Right click on the project select Apply Label (1) and in the next wizard (2) select the version in which you want to apply the label, default option is Latest Version and click ok. 3. Then give the Name of the label and the comments for the project and click ok (3).

6.2 How to get latest version


Right click on the project and select the Get Latest Version options; it automatically gives you the latest version of the code which was checked in earlier.

Wipro Confidential 2013

25

Date 27-08-

Team Foundation Server User Guide

Whitepaper

6.3 How to get Specific version


To get a specific version of code from TFS, we have a 4 different types namely, Change Set, Date, Label, Latest Version, Workspace Version. 1. Right click on project select Get Specific Version option.

2. Click on the Type list box in Version section, we you can see the 4 different options. Select the required option and click Get.

6.3.1 Get Specific Version by Changeset


Select the Type as Changeset and click on the button next to Changeset Text box, it will brings you the new wizard were you can see a Range like

Wipro Confidential 2013

26

Date 27-08-

Team Foundation Server User Guide

Whitepaper

a) All Changes: It will brings you all the change of code in TFS. b) Changeset Number: If you have a changeset number, give the number in from and to tab. c) Created Date: If you have date when you checked in the code give the date between and date. Select the appropriate option which you required and click on Find then you can see the details in Result section and click Ok.

Wipro Confidential 2013

27

Date 27-08-

Team Foundation Server User Guide

Whitepaper

6.3.2 Get Specific version by Date


Select the Type as Date and select the required date and click on Get.

6.3.3 Get Specific Version by Label


Select the Type as Label and click on the button next to Label text box; it will navigate to a new wizard. Were you give the name of the Label, Project and the Owner name and select Find. It will give you the code with appropriate label name and select the label and close the wizard and click on the Get button in Get wizard.

Wipro Confidential 2013

28

Date 27-08-

Team Foundation Server User Guide

Whitepaper

6.3.4 Get Specific Version by Latest Version.


This option is similar to which we discussed in section 6.2. select the type as Latest Version and click Get, it will get the latest code from the TFS.

6.3.5 Get Specific Version by Workspace Version


Select the Type as Workspace Version and select the workspace were you check in your code and click Get.

6.4 How to View Pending Changes


You can open the Pending Changes window to view all pending changes for your project. For each pending change, you can view the associated work items, the associated

Wipro Confidential 2013

29

Date 27-08-

Team Foundation Server User Guide

Whitepaper

check-in notes, and any policy warnings that are caused by this check-in. You can also compare the pending change with another version of the file. You can commit specified pending changes by performing a check-in to Team Foundation version control. Before you check in your pending changes, use the Get Latest command to download the most recent sources from the server, and then compile your code to make sure that it does not break the build. As part of your check-in, you can associate or resolve work items with the changeset and you can provide check-in notes. You can review adherence to check-in policy for the changes. These policies are configured by an administrator and if necessary, the policies can be overridden. You must resolve any conflicts that are caused by your pending changes. If conflicts occur, a dialog box appears, and you must resolve them before you can complete the operation.

If you have made changes to one or more files that are under version control and you want to discard those changes, you can undo those pending changes. You might do this if a change is believed to be too risky, or if testing determines that the change introduces new quality or performance issues. If you have already checked in the change and want to revert it, you must instead roll back the change. You cannot roll back changes by using Team Explorer Everywhere. You must instead use the command-line client for Visual Studio. When you revert changes, you will be prompted to confirm the operation for any files that have changed. You will not be prompted if any of the following conditions are true: The pending change is not of type edit. The pending change has no working folder mapping. This should occur only if the mapping was removed.

Wipro Confidential 2013

30

Date 27-08-

Team Foundation Server User Guide

Whitepaper

The files contents have not changed from the server.

6.5 How to lock


You can use the lock command to temporarily prevent changes to a particular file or folder in the source control server. This can be helpful if you want to change an item in your workspace and then check it in without being forced to resolve any merge conflicts. Only one user at a time may hold a lock on a particular file or folder. If you want to prevent access to an item in a persistent way, you should use the Permission Command instead. Check-in lock A check-in lock is less restrictive than a check-out lock. When you apply a check-in lock, users can continue to make local changes to the item in other workspaces. But those changes cannot be checked in until you explicitly remove the check-in lock from the item or implicitly remove it by checking in your changes to the file. Check-out lock In Visual Studio Team Foundation Server 2012, check-out locks are generally not effective because of local workspaces (see Decide between Using a Local or a Server Workspace). Specifically, check-out locks are: Not enforceable because other users might be using local workspaces. Not available if you are using a local workspace.

Wipro Confidential 2013

31

Date 27-08-

Team Foundation Server User Guide

Whitepaper

Disabled if a member of the Administrators security group of your team project collection has enabled asynchronous checkout for your teams server workspaces.

A check-out lock prevents users who are using server workspaces from checking out and making changes to the locked item in their workspaces. You cannot apply a check-out lock to an item for which any pending changes exist, in any workspace other than your own.

6.6. How to Shelve and Unshelve Pending Changes


Shelving:
Shelving enables you to set aside the pending changes in your workspace to work on a higher-priority task or to share your code with another user for code review. Perform a Get Latest operation to synchronize your workspace with the latest server version. Then you must build your application to make sure that it compiles before you shelve it or check it in. Doing so gives you an opportunity to incorporate changes to versioned files that have been made outside your workspace. To shelve folders and files from Source Control Explorer In Source Control Explorer, right-click the file or folder, and then click Shelve Pending Changes. In the Shelve - Source Files dialog example, shelvetest) in the Shelveset name box. box, type the shelveset name (for

The Shelve - Source Files dialog box includes two options: Preserve pending change locally

Wipro Confidential 2013

32

Date 27-08-

Team Foundation Server User Guide

Whitepaper

By default, this option is selected. When this option is selected, the changes you made to the files or folders in your local workspace are preserved. Evaluate Policies and check-in notes before shelving

When this option is selected, all check-in policies are evaluated before the shelveset is created. For more information, see Set and Enforce Quality Gates. In the Comment box, type Testing my shelveset, and then click Shelve. The files and folders are copied to the version control server and are available for other team members to unshelve.

Unshelving When you unshelve a shelveset, Team Foundation restores each shelved revision to the destination workspace as a pending change as long as the revision does not conflict with a change that is already pending in the workspace. The two most common reasons why you might want to unshelve a shelveset are: No-touch code reviews (or workspace impersonation). Integrate shelved pending changes into your work in the future.

To unshelve a set of pending changes

Wipro Confidential 2013

33

Date 27-08-

Team Foundation Server User Guide

Whitepaper

1. In Team Explorer, click File, point to Source Control, and then click Unshelve Pending Changes. 2. The Unshelve dialog box appears. 3. In the Owner name box, type the alias of the person who created the shelveset (for example, ADVENTUREWORKS\JuanGo or just juango), and then click Find. 4. In the Results pane, select the shelveset your workspace, and then click Details. you want to unshelve into

5. In the Shelveset Details dialog box, if you want to delete the shelveset from the Team Foundation version control server, clear the Preserve shelveset on server box. 6. As an option, clear the Restore work items and check-in notes option if you do not want to restore the work items and check-in notes that are associated with the shelveset. 7. Select the shelveset or shelveset items that you want to unshelve into your workspace, and then click Unshelve. Unlike the Get operation, which merges reconcilable differences between two versions of a file automatically and helps you merge conflicts manually, the unshelve operation does not support merges. By removing shelved pending changes from your workspace at the commencement of the code review, you can be assured that any changes that your reviewer makes to the shelveset, such as adding comments to a file, do not create merge conflicts during the unshelve process.

Wipro Confidential 2013

34

Date 27-08-

Team Foundation Server User Guide

Whitepaper

6.7 How to View History


To view the History of your project, right click on your project under source control and select View History.

6.8 How to compare a code


Team Foundation includes a tool named Difference Viewer that lets you compare two files and identify their differences. The following procedures demonstrate how to compare files, folders.

Comparing Files
With the Difference Viewer, you can compare two versions of a file. The following procedures demonstrate how to compare two files both from Solution Explorer and Source Control Explorer.

To compare files from Solution Explorer or Source Control Explorer


1. In Solution Explorer or Source Control Explorer, highlight the file or folder that you want to compare, right-click, and choose Compare. The Compare dialog box appears and the Selected file text box shows the file that you chose.

Wipro Confidential 2013

35

Date 27-08-

Team Foundation Server User Guide

Whitepaper

2. In the Compare to text box, either type the path and name for the file that you want to compare your selected file to, or click the ellipses () to open the Open dialog box from which you can locate the file that you want to compare to. 3. In the Compare by list box, choose the version that you want to compare by: o Changeset o Date o Label o Latest Version o Workspace 4. Click Compare, if the files have no differences, the Microsoft Visual Studio dialog box appears informing you that the files are identical, click OK. Otherwise, the Difference Viewer appears.

Wipro Confidential 2013

36

Date 27-08-

Team Foundation Server User Guide

Whitepaper

5. In the Difference Viewer, the differences will be highlighted. You can use the toolbar to navigate between all the areas in the file where differences are detected. 6. When you are finished comparing the files, exit the Difference Viewer.

Wipro Confidential 2013

37

Date 27-08-

Team Foundation Server User Guide

Whitepaper

6.9 How to get a code from TFS


1. To get a code from the source control, File -> Source Control -> Workspaces

2. In Manage Workspace wizard select your workspace(system were you saving your
code).

Wipro Confidential 2013

38

Date 27-08-

Team Foundation Server User Guide

Whitepaper

3. Then in Edit Workspace wizard under Working folders select the path of you project in Source Control Folder. 4. After selecting the path for Source Control, select the local path were you need your code to be placed, once Source control Folder and Local Folder was selected click Ok.

5. Then Right click on your project folder in Source control and select Get Latest Version, the latest version of code from TFS will now present in the local folder.

Wipro Confidential 2013

39

Date 27-08-

Team Foundation Server User Guide

Whitepaper

6.10 Binding or Unbinding a Project from Source control


1. To Bind or Unbinding your project from source control, select File -> Source Control -> Change Source Control.

Wipro Confidential 2013

40

Date 27-08-

Team Foundation Server User Guide

Whitepaper

2. In Change Source Control wizard, to Bind you project to Source control select your project and click Bind then your project will be bind to TFS.

3. To Unbind the project select the project and click Unbind.

References
http://msdn.microsoft.com/en-us/library/ http://blogs.msdn.com/b/visualstudioalm/

Wipro Confidential 2013

41

Date 27-08-

Das könnte Ihnen auch gefallen