Team Foundation Server - Source Control


Published on

This presentation focusses on :
-TFS- an Overview
-Managing Branches
-Code Integration

Published in: Technology
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Team Foundation Server - Source Control

  1. 1. Team Foundation Server Source Control<br />Dhirendra Singh<br />Principal Software Engineer<br />Zenevo Technologies<br />
  2. 2. Agenda<br />TFS- an Overview<br />Managing Branches<br />Merging<br />Code Integration<br />
  3. 3. What is Team Foundation Server?<br />It is the “Glue” that connects our team<br />What am I supposed to do?<br />What’s my progress?<br />What’s broken?<br />Helps manage project artifacts<br />Source Control<br />
  4. 4. Visual Studio Team System<br />
  5. 5. How it is helping us?<br />Helps our team communicate <br />Centralized place to manage our project<br />Data is captured automatically<br />Everyone looks at the same data<br />It is Customizable<br />Artifacts version/source control<br />Minimize / eliminate lost work<br />Reproducible builds & product state<br />
  6. 6. Team Foundation Server<br />Team Foundation Server<br />Version Control<br />Reporting and BI<br />Team Build<br />Work Item Tracking<br />Team Portal<br />
  7. 7. Team Foundation Server<br />Dev Team (Remote)<br />Dev Team (Local)<br />Build Agent<br />Windows 2003 Server<br />SQL Server 2005<br />IIS 6.0<br />Business User<br />Version Control Proxy (Remote)<br />Active Directory<br />HTTP / S<br />TCP/IP<br />Team Foundation Server<br />
  8. 8. TFS Source Control: Terminology<br />Workspaces<br />Area on local disk where you edit files<br />Check in / check out<br />Check out marks the beginning of your edits<br />Check in commits your changes to the repository<br />TFS allows shared check out<br />Changesets<br />Group of changes that happen when you check in<br />It works similarly as Label<br />Shelving<br />Similar to check in <br />Changes get stored on the server <br />Not visible as part of the main project source tree<br />For the purpose of Park your changes & go ahead<br />Branching<br />Used to manage multiple versions of a product<br />Helps in Release Process (Bug Fixes, Developing new features, Service Packs)<br />8<br />
  9. 9. TFS does more than just check-in and check-out<br />Branching and merging<br />Facilitates simultaneous development of multiple versions of an application<br />Applying Labels<br />Cloaking<br />Shelve & Unshelve<br />
  10. 10. What should go into source control?<br />Solution files -- *.sln<br />Project files -- *.csproj, *.vbproj<br />Source Control Project Metadata (*.vspscc)<br />Project bindings<br />Source control configuration<br />Application config files (*.config)<br />Source files <br />Project Binaries dependency references (e.g. Third Party dlls, Components)<br />10<br />
  11. 11. What shouldnot go in source control?<br />Solution user option files (*.suo)<br />Local user customizations<br />Project user option files (*.user)<br />Local user customizations<br />WebInfo files (*.webinfo)<br />Build outputs<br />/bin/debug<br />/bin/release<br />/obj<br />11<br />
  12. 12. Client-side vs Server-side Structure<br />Directory structure should be the same<br />Client-side structure should match server<br />Simplifies “Get Latest”<br />Everyone has the same directory layout<br />This doesn’t mean that everyone has to put their source in the same place on disk<br />The relative paths should match<br />Root path of source tree can be different<br />12<br />
  13. 13. Plan your Repository<br />Recommended file structure for Version Control.<br />
  14. 14. Recommended File Structure<br />
  15. 15. Don’t Branch... until<br />You have a good reason<br />Life only gets more complex with branching<br />Favor Labels over Branches<br />You can always branch from a Label later<br />15<br />
  16. 16. When to branch…The Signs…<br />Regular broken builds<br />Features in parallel development that need to edit one another<br />Branch so that each feature can develop in isolation<br />Merge changes later<br />Avoid source tree being polluted with experimental code.<br /> Allow work on different versions of product at same time<br /> Support maintenance releases etc<br /> Allow parallel Development<br />Ask yourself if the productivity gained by the branch is balanced against the pain (anti-productivity) of merging changes back<br />16<br />
  17. 17. SO…IF YOU REALLY MUST BRANCH…<br />17<br />
  18. 18. Branching Scenarios<br />No Branching<br />Everyone works from the same code<br />Branch for Release<br />Stabilization in order to prepare for a release<br />Branch for Maintenance<br />Maintenance of a previous build/release<br />Service pack development<br />Branch for Feature<br />Branch from the Trunk to develop a new feature (such as a new module in isolation)<br />Merge back into the Trunk when feature is done<br />Branch for Multiple Teams<br />Branches for multiple teams working on a set of features<br />18<br />
  19. 19. Branch For Release : Process<br />Main<br />Source<br />Release 1<br />Source<br />Release 2<br />Source<br />19<br />
  20. 20. Branch For Maintenance<br />Similar to Branch For Release<br />Main<br />Source<br />Maintenance<br />Release 1<br />Source<br />Release 2<br />Source<br />20<br />
  21. 21. Branch For Feature<br />Branching for development isolation<br />Main<br />Source<br />Development<br />Feature 1<br />Source<br />Feature 2<br />Source<br />Feature 3<br />Source<br />21<br />
  22. 22. Branch For Feature: The Process<br />22<br />
  23. 23. Branch For Teams<br />Main<br />Source<br />Development<br />Team 1<br />Feature 1<br />Source<br />Feature 2<br />Source <br />Team 2<br />Feature 1<br />Source<br />Feature 2<br />Source <br />23<br />
  24. 24. Branching Overkill<br />Minimize the number of branches<br />Watch out for branching problems<br />Missed deadlines because the merge is too difficult, long, intricate, etc<br />Releases take forever because fixes have to go through multiple layers of merge<br />You’re simply spending too much time doing merges<br />24<br />
  25. 25. Branching and Merging<br />Source:<br />
  26. 26. Demo<br />Create a branch<br />Merge changes<br />Create/resolve a check-in conflict<br />Discussion about Baseless Merge<br />
  27. 27. Some News…<br />Bad news<br />Some features are command-line only<br />Good news<br />There’s a lot you can do from the command-line<br />Scriptable<br />
  28. 28. Beyond the GUITF.exe is your Friend<br />The most powerful for Team Foundation Source Control is the command line.<br />
  29. 29. TF.exe<br />Command-line interface to TFS source control<br />30+ sub commands<br />Kind of like “net” command in Windows<br />Why would you want to use the command line version?<br />It’s cool<br />Some things aren’t available through the UI<br />Good for automated operations (builds, etc)<br />
  30. 30. The Commands<br />Add<br />Branch / Branches<br />Changeset<br />Checkin / Checkout<br />Configure<br />Delete / Undelete<br />Dir<br />Get<br />History<br />Label / Labels / Unlabel<br />Lock<br />Merge / Merges<br />Move<br />Permission<br />Properties<br />Rename<br />Resolve<br />Shelve / Unshelve<br />Status<br />Undo<br />View<br />Workfold<br />Workspace / Workspaces<br />
  31. 31. Things you (probably) can’t do through the GUI <br />Find files in TFS by name/wildcard<br />tf dir<br />Get particular version of a file(s) by wildcard<br />tf get<br />Find checked out / pending change files<br />tf status<br />What will be changed by a “get latest”?<br />tf get /preview<br />Baseless merges<br />tf merge /baseless<br />Eliminating a changeset from a merge<br />tf merge /discard<br />
  32. 32. And Last but not the Least…<br />
  33. 33. Baby Come Back<br />Accessing Deleted Files<br />Tools, Options, Source Control, Show deleted items in Source Control Explorer.<br />Undelete file. Remember to add to solution…<br />
  34. 34. Extending TFS<br />Use the .NET object model to extend Team Foundation Server<br />
  35. 35. Check out != Get Latest<br />and Also<br />Check-in != Get Latest<br />
  36. 36. Change != Bad<br />TFS is new and different – you folks will need time to adjust.<br />
  37. 37. Best Practices- References<br /><br />Lots of great info<br />Free<br />Released Aug 2007<br />37<br />
  38. 38. Question and Answer<br />Dhirendra Singh<br />Principal Software Engineer<br />Zenevo Technologies Pvt. Ltd.<br /><br /><br /><br />