• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Featured
    • C# Tutorials
      • LinQ Tutorials
      • Facebook C# API Tutorials
    • PHP Tutorials
      • CodeIgniter Tutorials
    • Amazon AWS Tutorials
  • Categories
    • Programming
    • Development
    • Database
    • Web Server
    • Source Control
    • Management
    • Project
  • About
  • Write
  • Contact

CodeSamplez.com

Programming, Web development, Cloud Technologies

You are here: Home / Source Control / Microsoft Team Foundation Server- TFS Source Control System

Microsoft Team Foundation Server- TFS Source Control System

April 25, 2012 by Rana Ahsan 3 Comments

If you don’t know anything about Team foundation server, then you might be thinking that, its some kind of tool like SVN/GIT etc source version control system. But, version control is only a part of this.Team foundation server(in short, TFS), is a great innovation of Microsoft, that is integrated with Visual Studio and provide a easy/effective way to manage a software development project completely. A single tutorial won’t be enough to cover all its features. So, in this tutorial, I will be explaining the tfs source control part only. Also, as this tutorial is intended for developers only, I will only cover installing/configuring TFS client only. And of course, details on how to use it.

Installing:

If you are using visual studio 2008, then you must need to have service pack 1 installed before you can install team foundation client software. you can download the team system client for vs 2008 from this microsoft download link.

If you are a visual studio 2010 user, then you won’t have to do anything and its already a part of visual studio 2010. So, no need for any external installation. Also, For this tutorial, I have used visual studio 2010 and this is highly recommended.

Configuring:

To Start working with TFS, first we will have to connect to TFS server and setup the initials. On visual studio menu, you should see a menu named ‘Team’, which will include only one option titled ‘Connect To Team Foundation Server’.
Team System Menu On VS2010
From here, you will get an ‘Connect To Team Project’ dialogue. This originally contains the listing of team projects on a selected server. As we don’t have any server configured, there will be nothing here at this moment. Click on the ‘Servers’ button.
Connect To Team Project Dialogue
This should give you another new dialogue which can be used to manage TFS severs. That means, you can add or remove a server here. However, I didn’t find a way to edit a server though,(is this a limitation that we can acknowledge? :p).
Managing TFS Servers
Well, now as we need a server, if you just click on the ‘Add’ button, you should come up with another(oh, yes, 🙂 ) new dialogue.
Adding A TFS Server
here, you can provide the url, port, extra uri path,protocol(http/https). However, instead of giving individual details, if you give a complete url that contains all info, will work also. This can be like “http://yourtfsserver.com:8080/extrauripath”.

After you have added the server. select it on “Connect to Team Project” dialogue(It should be automatically selected if only one server). Now, select proper ‘Project Collection'(If more than one) and then select your specific project.
Then you should be prompt to select a local pc directory where you wish to save all the files. then, it will perform a complete ‘checkout’ operation that will download all latest files from the server(nothing if a new empty project).

Browse Server Contents:

There are two windows to get you see the server files. First, On ‘View -> Team Explorer’ you will see the team foundation server’s all items like Work Items,Documents,Reports,Builds and Source Control. The main concern for us at this moment is to use the ‘Source Control’ part. If you click on that option, you will get to another new window, which actually shows you all server files inside your team foundation server project.

Adding/Deleting Files/Directories To Source Control:

You should be able to see some options on the top bar of source control explorer window. Similar options will be found if you right click of your mouse inside the area. To add one/more file(s)( or directories), just use the ‘Add Items To Folder’ option to do so. Here, I want to add a suggestion that, although you will be able to select files from other directories as well, it will be best to, first add items to your local file system (relatively) where you want them to be placed on server. then add the add option on source control explorer to add them from there.

After you perform the addition, those files/directories won’t be committed to server yet. You will then have to perform another operation named ‘Check In Pending Changes’ to add them permanently to tfs server(its similar to the commit option on SVN)

Similarly you can delete files/folders from server using the ‘delete’ option and then finally checking in the pending changes. Here, just to mention, remove something using the source control explorer will not necessarily remove them from your local file system. You can do it manually.

Edit File:

To Edit a file, you should first use the option ‘Checkout for edit’ to acknowledge server that you are going to edit this file. This will be notified to other developers also and they will see this in edit mode through source control explorer. Also, until you checkout a file for edit, files will be in ‘read only’ mode. As a result, you won’t be able to edit it externally(However its still possible to do so from within visual studio). So, checking out for edit is kind of must for binary files(like doc file etc) at least. Also, if you edit a file in offline mode(not connected to tfs server), it will detect the edited files and will convert them to ‘edit’ mode after you get to online.(However, it doesn’t work all the time, I have a little doubt is need some special user action or not, I will confirm it here asap I get some clue).

Merging And Branching:

TFS has merging and branching facility as well. If your local version doesn’t fit with server version, in short, if any conflicts occurs, you can either manually merge them in merge tool or you can command tfs to do auto merge(you will only get this option if TFS thinks that it can be merged automatically).

If you have to work on several files and all are related to a single feature, its best to create a branch of the project or code file(s) and work on them. After finishing your task. you can again use the TFS merge command with the main branch and it will automatically incorporate those changes itself. Finally, you will have to commit as well.

Shelve Set:

If you are a earlier SVN user, then you may be new to this term. Team foundation server has this feature, which allows you to save your local edit as a separate item in server, which can be retrieved and reviewed by other developers of your team. After approval suggestions, it can be deleted or check in to the main version control stream.

Create Shelve Set

However, this is actually designed to be used with software development life cycle through team foundation server. I will explain about it more on upcoming days on some other tutorial describing maintaining software development life cycle using tfs.

References:

Hope this tfs source control tutorial is helpful to you. I haven’t discuss about any basic overview about overall team foundation server architecture. You can follow the links below to get some if you haven’t.

  • MSDN References for team foundation server
  • Blog Article to start with team foundation server

Let me know if you are having issue with understanding any part.Happy programming 🙂

Share If Liked

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pocket (Opens in new window)

You may also like

Filed Under: Source Control Tagged With: .net, tfs

About Rana Ahsan

Rana is a passionate software engineer/Technology Enthusiast.
Github: ranacseruet

Reader Interactions

Comments

  1. Robert says

    February 20, 2013 at 3:37 am

    Very nice article.

    Reply
  2. Howie says

    November 20, 2014 at 1:08 pm

    Nice thanks. It’s been over 2 years, have you finished your “other tutorial describing maintaining software development life cycle using tfs”?

    Reply
    • Md Ali Ahsan Rana says

      November 20, 2014 at 4:25 pm

      Yup, its already available here: tfs sdlc tutorial. I can understand your confusion/problem to find the other article, thanks for pointing that out. I will update the article with proper linking soon.

      Reply

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3,774 other subscribers

Follow Us

  • Twitter
  • Facebook

Top Posts & Pages

  • How To Work With JSON In Node.js / JavaScript
    How To Work With JSON In Node.js / JavaScript
  • PHP HTML5 Video Streaming Tutorial
    PHP HTML5 Video Streaming Tutorial
  • How To Work With C# Serial Port Communication
    How To Work With C# Serial Port Communication
  • Facebook C# API Tutorials
    Facebook C# API Tutorials
  • Using Supervisord Web Interface And Plugin
    Using Supervisord Web Interface And Plugin
  • LinQ Query With Like Operator
    LinQ Query With Like Operator
  • Get Facebook C# Api Access Token
    Get Facebook C# Api Access Token
  • How To Use Hotkeys/Keyboard Events In WPF Application Using C#
    How To Use Hotkeys/Keyboard Events In WPF Application Using C#
  • Control HTML5 Audio With Jquery
    Control HTML5 Audio With Jquery
  • Generate HTTP Requests using c#
    Generate HTTP Requests using c#

Recent Posts

  • Building Auth With JWT – Part 2
  • Building Auth With JWT – Part 1
  • Document Your REST API Like A Pro
  • Understanding Golang Error Handling
  • Web Application Case Studies You Must Read

Tags

.net angularjs apache api audio auth authenticatin aws c# cloud server codeigniter deployment docker doctrine facebook git github golang htaccess html5 http javascript jwt linq mysql nodejs oop performance php phpmyadmin plugin process python regular expression scalability server smarty socket.io tfs tips unit-test utility web application wordpress wpf

Footer

Archives

Follow Us

  • Twitter
  • Facebook

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 3,774 other subscribers

Copyright © 2023