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
- Visual Studio 2010/2008/2005 with SP1.
- TFS for Visual Studio: https://download.microsoft.com/download/4/4/C/44CD7FE1-CA53-441C-863C-F7E78F24D092/VS2010TE1.iso
- Forward compatibility plug-in for (Note that you need Service Pack 1 installed for Visual Studio for forward compatibility plug-ins to work):
- For VS 2005: https://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3263
- For VS 2008: https://www.microsoft.com/download/en/details.aspx?id=10834
You can access the TFS web as well
2.0 Setting up Team Foundation Server for the first time:
Open the Visual Studio
Go to View > Team Explorer (Ctrl + M) Shortcut
Click on “Add Existing Project “ Icon as in the below screen
Click on “Servers” Button
In Servers dialog box, Enter the details:
- Server Name: https://TFS-Server-Address.org
- Path: tfs
- Port Number: 8080
- Protocol: HTTP
Then select the project name, for e.g. “SharePoint” from the project list and click on “Ok” button
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”
Click on “Add” button
Click on the “…” Button on the “Source Control Folder” column
Select the “SharePoint” Project in the list and click “OK” button
and then under the Local folder, Select the local folder from your machine, where the TFS artifacts will be stored
Now, Click on “Ok” button to save the changes.
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”
Open the TFS, and Click on “Add Item” icon as highlighted in the below picture
Pick the file/folder from your Local “Workspace” folder, and click on “OK” button to add.
Once added, you will get a small + Icon to the file name, which denotes this change needs to be committed with the TFS Server.
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.
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.
This will open a window, which has all the new changes from the Local workspace
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”
This will retrieve the latest files from the TFS to the Local workspace folder.
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”
Select the Lock type, typically it would be “Unchanged”
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”
Enter the optional comments, and click on “Check-In” Button.
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.
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
This will give a list of versions, from which we can view/copy the files of prior versions.
To get a Prior version: Right click on the desired folder and choose “Get Specific Version”
You can restore a specific version based on Change Set value, Date, comments, etc