Background
According to Wikipedia Team Foundation Server (commonly abbreviated to TFS) is a Microsoft product that provides source code management (either via Team Foundation Version Control or Git), reporting, requirements management, project management (for both agile software development and waterfall teams), automated builds, lab management, testing and release management capabilities.
It covers the entire application lifecycle. TFS can be used as a back-end to numerous integrated development environments (IDEs) but is tailored for Microsoft Visual Studio and Eclipse on all platforms.
Contents:
- TFS Requirement
- TFS Installation
- TFS Project Collection
- TFS Team Project
- Configure Workspace
- Manage Source Control
- TFS Settings
- Compare
- Branching
- Merging
1.TFS Requirement:
TFS installation supported on a Microsoft Windows server/client OS. Before installation let’s have a review the System requirements for Team Foundation Server
Operation System
- Server OS
- 64-bit versions of Windows Server 2012 R2 (Essentials, Standard, Datacenter)
- 64-bit versions of Windows Server 2012
- 64-bit versions of Windows Server 2008 R2 (Standard, Enterprise, Datacenter)
- Client OS
- Windows 10
- Windows 8.1 (Basic, Professional, Enterprise)
- Windows 8
- Windows 7 (Home Premium, Professional, Enterprise, Ultimate)
SQL Server
- SQL Server 2014 ¹ (Express, Standard, Enterprise)
- SQL Server 2012
Get a full review here.
2.TFS Installation:
Microsoft has published a “TFS Install and Administration Guide” in CHM form for download. Here you can go through by clicking the link & get it – TFS Install and Administration Guides.
I am using Windows 10 with SQL server 2014 as installation pc. Let’s get into topic step by step.
FIG: 1 let’s open the tfs server setup file.
FIG: 2 in this step a popup with setup screen will appear, accept the term and click “Install Now”.
FIG: 3 as you can see Installation is in progress.
In our next step we have to choose a installation wizard
- Basic wizard
- Install the essential service along with SQL express installation.
- Advance wizard
- Install all installation option.
FIG: 4 we will install using Advance wizard. Click “Start Wizard”
FIG: 5 Advance wizard will popup. Choose “Next”.
FIG: 6 in this step we need to specify a database server, we can also use an existing empty database by specify a database name. Choose “Next”.
FIG: 7 Here we need to provide a service account as primary account for TFS. Choose an option. In my case i have kept as default(NT AUTHORITY\LocalService) which will authorizes on behalf of my account t does not have a password. Choose “Next”.
FIG: 8 here in “Application Tire” we will configure directory & port for TFS web service. Choose “Next”.
FIG: 9 locate a folder path for cache TFS resource which will access frequently to increase communication performance. Choose “Next”.
FIG: 10 Tick check box if you want to install a default collection(recommended) in your TFS Server. Choose “Next”.
Overview on creating new collection from here.
FIG: 11 let’s get review our Installing Component. Choose “Next”.
FIG: 12 in this step our system will get validate & need to get passed to conduct installation. Choose “Next”.
FIG: 13 after passing readiness check, configuration process start. Success message will display after completing all process. Choose “Next”.
FIG: 14 this is the final step. Review the result here & go to the link to get enabled TFS web services. Choose “Close”.
FIG: 15 Go to > All Apps > Microsoft Team Foundation Server
FIG: 16 Finally TFS Administration Console Installed, that manage entire application life-cycle.
3.TFS Project Collection
Team project collection is a group of project to manage multiple project from a single location. Let’s start with TFS Administration Console.
FIG: 17 In Team Project Collections, choose Create Collection.
FIG: 18 The Create Team Project Collection wizard opens.
FIG: 19 In Name filed, specify a name for your collection. Under Description, you can optionally specify a brief description of your collection and it's purpose. Choose Next.
FIG: 20 In SQL Server Instance, specify local/remote server name that host the database for the collection. Check first option for creating a new database for the collection, if you have existing empty database that created before you can specify that by checking second option. Choose Next.
FIG: 21 in this step review the settings. Click Verify.
FIG: 22 in this step show verified status whether the TFS collection is ready to create or not. Click Create.
FIG: 23 the creation process starts.
FIG: 24 after completing all required process successfully the wizard finishes, Choose Close.
FIG: 25 as you can see, finally the collection is listed in the console window.
4.TFS Team Project
Let’s open Visual Studio 2013 to connect TFS server. From Visual Studio menu bar Choose [TEAM > Connect to Team Foundation Server] to connect TFS server.
FIG: 26
FIG: 27 In Name/URL type Local/Remote URL of TFS server. The default Port is 8080. In this case I have used local PC Name as server. Click OK.
FIG: 28 Team Project Collection will appear. Choose desired collection & Click Connect.
FIG: 29 after connecting TFS click on Source Control Explorer from Team Explorer to view the TFS Project Collection. From Visual Studio menu bar Choose [File> New > Team Project].
FIG: 30 specify Name & Description for new TFS Project. Choose Next.
FIG: 31 choose a project template to manage Team project. Choose Next.
FIG: 32 specify a version control setting. Choose Next.
FIG: 33 confirm setting. Click Finish.
FIG: 34 as you can see finishing status will appear after creating TFS project. Click Close.
5.Configure Workspace
Workspace is a local copy where develop & test code. We can manage our workspaces from the Team Explorer. A default workspace created automatically, also we can maintain multiple workspace.
FIG: 35 to modify Click Workspace.
FIG: 36 to modify existing workspace, Click Edit.
FIG: 37 edit workspace window will appear, Click Advanced.
FIG: 38 edit workspace window will appear with advanced option, here we can specify workspace whether its location is Local or Server. Click Ok.
FIG: 39 browse source control folder path for working items. Click Ok.
FIG: 40 browse local folder path for working items. Click Ok.
FIG: 41 yes/no prompt window will appear with instruction of workspace modification. Choose Yes.
6.Manage Source Control
TFS source control is a software configuration management that manage project folder & files of large scale of development component.
To Add item Go to > Team Explorer > Source Control
FIG: 42 add folder structure/file in this step. File/folder will add with a plus icon that indicate item has added to source control. After check-in item the icon will change.
FIG: 43 right click on project collection choose check in pending changes to upload the added file to server.
FIG: 44 pending changes will included in team explorer, add description in comment field while check in. Click Check In.
FIG: 45 right click on main branch choose Add Items to Folder.
FIG: 46 browse desired local file to add to source control. Choose Finish.
FIG: 47 double click on project solution that we have added to source control. A configuration warning will appear that ask to bind the solution to source control. Click Yes.
FIG: 48 Select the project solution then click Bind.
FIG: 49 as you can see an extra file (.vssscc extension) is added to source control with bind information properties.
FIG: 50 let’s update the pending changes to server. Click Check In.
FIG: 51 as you can see the files are successfully checked in to the server.
FIG: 52 build/rebuild the solution.
7.TFS Settings
Workspace setting:
FIG: 53 Go to [Team Explorer > Setting]
FIG: 54 Go to [Team Project Collection > Source Control]
FIG: 55 Go to tab [Workspace Setting] choose a default workspace type & Click Ok.
Two types of workspace. As you can see from below image
- Local workspace and
- Server workspace
With local workspace we can work offline to perform source control operations without going TFS server (Online). Working offline have no option of checkout locks.
The other hand while we are using server workspace there is a checkout lock which prevent to work on single file by multiple user same time.
Check-in Policy
In TFS we can add check in policy, while user is going to check in pending changes.
By default, the check-in policy types:
- Builds: Requires last successful before a check-in.
- Changeset comment policy: Requires comment before check-in.
- Testing Policy: Requires tests before check-in.
- Work Items: Requires work items to be associated with the check-in.
FIG: 56 Select [Team Explorer > Setting] then Go to [Team Project > Source Control] source control setting window will popup.
FIG: 57 As you can see from below image in Check out Setting tab enable multiple check-out checkbox is not selected due to prevent working on single file by multiple user at the same time. The other option will ensure that latest file is going to checkout and updated.
FIG: 58 In the Check in-policy tab we have choose changeset comment policy to ensure that a comment must be provided while the file is going to check-in by user.
8.Compare
TFS has facility to compare two files/ single file by changeset to see their differences.
FIG: 59 Go to [Solution Explorer > Compare] like below image.
FIG: 60 select a type Click Ok.
FIG: 61 in this window choose find option to compare between changeset.
FIG: 62 as you can see from below image, the changes of same file with different changeset.
Branching & Merging
TFS has great facility of branching & merging. In TFS we can create/convert a folder to Branch or Branch to folder.
9.Branching:
FIG: 63 in TFS we can convert a folder to branch or create a new branch. Go to [Source Control Explorer > Branch and Merging > Convert to Branch] like below image.
The folder will convert to a branch as well as TFS change the icon at the same time.
FIG: 64 from our converted folder we may now create a new branch by choosing the option “Branch”. In source control right click on converted folder then choose Branch and Merging > Branch.
FIG: 65 type a branch name with specifying description in description field and click Branch.
FIG: 66 yes/no prompt will appear, Click Yes to perform the operation.
FIG: 67 as you can see a new branch is created with our specified name “DEVELOPMENT”. Perform “Get Latest version” action to update the local files downloading from server.
10.Merging
Merging branch is another TFS great option to combine the changes between two branches. In this option we must require to resolve the conflicted file.
FIG: 68 right click the updated folder choose Branching and Merging select Marge.
FIG: 69 a wizard will appear with source & target branch path. Choose Next.
FIG: 70 choose a type then click next.
FIG: 71 TFS will do a marge operation between branches with pending changes.
FIG: 72 all changed file will included in pending list. Perform a check-in operation to update the TFS server with changed file. Click Check in.
FIG: 73 Finally Let’s build and run the application.
Hope this will help || Reference: https://msdn.microsoft.com