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