Home / Team Foundation Server (TFS) / Rules to Better Version Control With TFS (AKA Source Control)

Rules to Better Version Control With TFS (AKA Source Control)

Hold on a second! How would you like to view this content?
Just the title! A brief blurb! Gimme everything!
  1. Do you know how to ensure your build succeeded?

    When checking code into TFS, a build should be triggered as per the rule Do you know the minimum builds to create on any branch?

    You should not just trigger a build and walk away however – make sure that build succeeded!

    The first way is from within Visual Studio.

    Figure: Good Example – Check your build has passed from Team Explorer | Builds

    The second is by always having the TFS Build Notification tool always running. Through it you can subscribe to any builds you are interested in, when they start, end and their status.

    Figure: Better Example – Check your build(s) are continually passing by having the TFS Build Notification tool always running - Start | All Programs | Visual Studio 2012 | Team Foundation Server Tools | Build Notifications
  2. Do you know which check-in policies to enable?

    Check-in policies are a great way to enforce code quality before it hits your source control repository. SSW recommends that the following check-in policies be enabled by default on your project:

    1. Changeset Comments Policy - To enforce that all check-in contain comments
    2. SSW Code Auditor - To enforce coding standards and best practices before check-in
    3. Work Items – To ensure check-ins are linked to a Work Item in TFS

    ​​To enable these policies:

    1. Click Settings in the Team Explorer Home hub
    2. Click Source Control in the Team Project section (not Team Project Collection)
    3. Open the Check-in Policy tab
    4. Click Add... and select the check-in policies above. If you don’t have SSW Code Auditor installed, download it​!
    check in policies
    Figure: Choose check-in policies in TFS