TFS Basics Tutor for End User

Introduction: Team Foundation Server is a source control, data collection, reporting, project tracking, and is intended for collaborative software development projects. This guide briefs on the basics of using TFS.

  • 1.0 Pre-Requisites
  • 2.0 Setting up Team Foundation Server for the first time
  • 3.0 Adding New Files to TFS
  • 4.0 Committing changes to the TFS Server
  • 5.0 Get the Latest files from TFS
  • 6.0 Editing/updating files in TFS
  • 7.0 Deleting Files to TFS
  • 8.0 Going back to a Prior version

1.0    Pre-Requisites:

  1. Visual Studio 2010/2008/2005 with SP1.
  2. TFS for Visual Studio: http://download.microsoft.com/download/4/4/C/44CD7FE1-CA53-441C-863C-F7E78F24D092/VS2010TE1.iso
  3. Forward compatibility plug-in for (Note that you need Service Pack 1 installed for Visual Studio for forward compatibility plug-ins to work):
  1. For VS 2005: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3263
  2. For VS 2008: http://www.microsoft.com/download/en/details.aspx?id=10834   

You can access the TFS web as well 

tfs image001 1

2.0    Setting up Team Foundation Server for the first time:

Open the Visual Studio

tfs image001 2

 Go to View > Team Explorer (Ctrl + M) Shortcut

tfs image001 3

 Click on “Add Existing Project “ Icon as in the below screen 

tfs image001 4

Click on “Servers” Button

tfs image001 5

 In Servers dialog box, Enter the details:

  • Server Name:    http://TFS-Server-Address.org
  • Path:                     tfs
  • Port Number:    8080
  • Protocol:             HTTP
tfs image001 6

Then select  the project name, for e.g. “SharePoint” from the project list and click on “Ok” button

tfs image001 7

 Once you have team explorer connected, we need to create a “Work-space” to establish a connection between the TFS server and our local machine  Creating Work Space: Double Click on “Source Control” and then “Workspaces”

tfs image001 8

    Click on “Add” button

tfs image001 9

Click on the “…” Button on the “Source Control Folder” column

tfs image001 10

Select the “SharePoint” Project  in the list and click “OK” button

tfs image001 11

and then under the Local folder, Select the local folder from your machine, where the TFS artifacts will be stored

tfs image001 12

Now, Click on “Ok” button to save the changes.

tfs image001 13

3.0    Adding New Files to TFS

To add files to TFS, place the files in Local Workspace folder and add them through TFS. Here is an example:  Add a File Named “MOSS 2007 to SharePoint 2010 Migration IG.docx” in D:\TFS-SharePoint\Administration\Implementation Guides”

tfs image001 14

Open the TFS, and Click on “Add Item” icon as highlighted in the below picture

tfs image001 15

Pick the file/folder from your Local “Workspace” folder, and click on “OK” button to add.

tfs image001 16

Once added, you will get a small + Icon to the file name, which denotes this change needs to be committed with the TFS Server.

tfs image001 17

4.0    Committing changes to the TFS Server:

Once we add Files/folders to TFS, It just added to our local work-space. We need to commit our change to the TFS server in order to persist the change to reflect on the server.

tfs image001 18

Committing the change to the server: Right click on the Project folder or any other folder which consists of the change, select “Check-in Pending changes” from the Menu to commit the changes to the TFS Server.

tfs image001 19

This will open a window, which has all the new changes from the Local workspace

tfs image001 20

5.0    Get the Latest files from TFS

Under the Source control explorer, Right click on the Project Name “SharePoint” (or whatsoever) and select “Get Latest Version”

tfs image001 21

This will retrieve the latest files from the TFS to the Local workspace folder.

tfs image001 22

6.0    Editing/updating files in TFS

Files inside TFS workspace folders are READ-ONLY!!! So in order to edit the files, they need to be checked-Out First. To Check out files, Open the source control, Navigate the folder where the desired files are stored, right click on the File/Folder, click on “Check-Out for Edit”

tfs image001 23

Select the Lock type, typically it would be “Unchanged”

tfs image001 24

Now, you can edit the files either directly from TFS or from your local workspace folder. Once done with editing, check it in back by right clicking and choosing “Check in Pending changes”

tfs image001 25

Enter the optional comments,  and click on “Check-In” Button.

tfs image001 26

7.0    Deleting Files to TFS

To delete the files from TFS, Open the source control, Navigate to the Target folder and delete the file/folder.  Right click and choose “Delete” item from the Menu.

tfs image001 27

Once delete, commit the changes by “checking in the pending changes”

8.0    Going back to a Prior version

In TFS each check-in creates a new version. To get the particular version, Select the folder/file and choose “Version” menu item

tfs image001 28

This will give a list of versions, from which we can view/copy the files of prior versions.

tfs image001 29

To get a Prior version: Right click on the desired folder and choose “Get Specific Version” 

tfs image001 30

You can restore a specific version based on Change Set value, Date, comments, etc

tfs image001 31

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply