Successfully reported this slideshow.
Your SlideShare is downloading. ×

Taking your version control to a next level with TFS and Git

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 60 Ad
Advertisement

More Related Content

Slideshows for you (20)

Viewers also liked (20)

Advertisement

Similar to Taking your version control to a next level with TFS and Git (20)

Advertisement

Recently uploaded (20)

Taking your version control to a next level with TFS and Git

  1. 1. Who Am I? Alexander Vanwynsberghe Houthulst Working @ Cronos ALM (MVP) and ESN @Vanwynsberghea www.alexandervanwynsberghe.be
  2. 2. Source Control
  3. 3. Agenda Source control in general Git with Visual Studio Git on TFS or VisualStudio.com Git with TFS Build Git as deployment protocol Git on TFS in Cross-platform environments
  4. 4. Source Control Models Centralized Distributed
  5. 5. Back in the old days
  6. 6. Prior to TFS
  7. 7. “SourceSafe gives you the illusion of safety and control, while exposing your project to risk” “SourceSafe teaches developers bad habits like: avoid branching, exclusive locks, easy permanent deletions” Codinghorror.com
  8. 8. Visual Studio 2005 Team System Visual Studio 2008 Team System Visual Studio Team Foundation Server 2010 TFVC
  9. 9. Centralized Version Control System based on (server) workspaces
  10. 10. Rollback Cloak Check-out Add Shelving Changeset Label Check-out lock History Pending Change Check-in Compare
  11. 11. Disadvantages 1 Offline scenario’s 2 Read-only files 3 You need Visual Studio (or TEE or the Power Tools for Shell integration)
  12. 12. Server Workspaces • You talk to TFS when you check-out • Allows you to do security on check-out • Visibility at all times into what everyone is doing • Great for large codebases
  13. 13. Visual Studio Team Foundation Server 2012 TFVC V2 Local Workspaces
  14. 14. Centralized Version Control System based on (local) workspaces $TF
  15. 15. Local Workspaces • Default for TFS 2012 • No explicit checkout = easy to edit outside of Visual Studio or Eclipse • Get Latest & Check in Compares local cache against the server • Problematic for large codebases
  16. 16. Conclusion Strengths Best for • Scales to very large codebases • Large integrated codebases • Fine level permission control • • Control and auditability over source code down to the file level Allows usage monitoring • Offline editing support • Medium-sized integrated codebases • Easy to edit files outside Visual Studio or Eclipse • A balance of fine-grained control with reduced friction
  17. 17. If you really want TFVC if (number of files > 100,000 ) || (locking = required)) { return “consider server workspace”; } else { return “consider local workspace”; }
  18. 18. Server vs Local Workspaces
  19. 19. Modern Apps and OSS workflows  App Architecture: suite of loosely coupled systems  Team: Written by small/discrete and distributed  Platforms: Multiple platforms and dev environments (Windows, iOS, Android)  Open source components
  20. 20. There were 2 players Git
  21. 21. Git took off  Git is the Leading DVCS Tool  Adoption of Git is growing exponentially  Git as a Deployment Protocol  Used to deploy web applications on many cloud providers (Windows Azure, Heroku, Facebook)  Git has support across platforms
  22. 22. There were some principles 100% true Git join the community
  23. 23. Team Foundation Server 2013 & Visualstudio.com Git 100% Visual Studio 2012 (+Tools for Git) & Visual Studio 2013
  24. 24. Git Strengths Best for • Full offline experience • Modular codebases • Complete repository with portable history • Integrating with open source • Highly distributed teams • Simplified branching model
  25. 25. Team Foundation Server / VisualStudio online Project 1 3rd Party Project 2 Local Repo 3rd Party Other Remote Git Repo
  26. 26. Migration & Web Interface
  27. 27. for dummies
  28. 28. Git TFVC commit / push check-in fetch get-latest pull get-latest + merge
  29. 29. init/clone add Super Simple Git Workflow for the lone wolf Staged commit To a remote push
  30. 30. init/clone add/commit pull push Super Simple Team Workflow for the hyper agile team
  31. 31. Feature Branches init/clone Short lived, Isolated Sandboxes branch checkout checkout add/commit merge push
  32. 32. Clone the code
  33. 33. Push the modifications
  34. 34. Everything is synchronized
  35. 35. Branches
  36. 36. Using Git with Visual Studio
  37. 37. TFS Build
  38. 38. Deployment protocol
  39. 39. Cross-platform TEE EGit
  40. 40. TFS Build + Cross-platform
  41. 41. Enterprise class support Ease of installation Support and servicing Ease of management Integrated Authentication Enhanced permissions ALM Integration
  42. 42. I want to.. In Visual Studio? Command prompt Get information about your local repository (such as the remotes you are tracking) If the repository is in a TFS team project, then yes. Otherwise, no. git-remote No, but you can view them. You can use the command prompt to push, edit, and remove tags. Create or edit a note No You can use the command prompt to push, edit, and remove notes Amend your last commit No git-commit Undo a committed change by applying the inverse of the commit. No git-revert Re-order history or combine (squash) commits. No Rebasing Apply a tag to a commit
  43. 43. Team Foundation Version Control Git (hosted by TFS)
  44. 44. When to Pick TFVC Git • Developers familiar with Centralized version control • Developers want to use it • Highly coupled codebase • Tight audit/control requirements • Use of MyWork + Code Review • Using tools with built-in Git support • XCode / iOS Development
  45. 45. Remember Source Control is only a part of an ALM solution!

Editor's Notes

  • In this session, it will all be about “source control”.. So if you don’t like source control, this is not the place to be 
  • When you talk about source control models, you have 2 flavors:Centralized (who’s using..?)Distributed (who’s using..?)
  • Let me first start with a shield. Why? Well, when you are in one of the sides of this equitation, people tend to get fanatic about this. There are people saying “hell no, don’t use centralized, DSVC is the way to go!
  • Back in time.. Version control does exist already a long time.. There are like a dozen of tools and solutions available
  • Itwas good.. You had like one central “database” (on a fileshare)
  • “users” were complaining: http://www.codinghorror.com/blog/2006/08/source-control-anything-but-sourcesafe.html
  • TFVC was a follow-up from Visual Source Safe, but it was written from scratch (no link with SourceSafe) and uses a SQL Server database as a means of scaling to large environments and infrastructures.
  • Workspace: basically a mapping between a source control path and local file storage location.But you DO need the server.. You tell the server that you want to check-out files.. The server knows everything
  • There are lots of good things about server workspaces. Like exclusive locks, you know who’s editing which file
  • offline: you need to be connected to the server.. You tell the server what you want to do.. If the server is not available, you’re screwedRead-only: locks on a file.. You can manually remove those locks, but TFS will not know about themYou need visual studio!
  • Is this DVCS?NOPEThe server only has knowledge of a reference to a local workspace.. So it’s also a mapping!The local workspace links to file storage.. There is also something like $TF, where the information about your workspace is available
  • You need to talk to the server.. Because the server stores the history! The server is where permissions are controlled
  • App architecture is loosly coupled nowadays. There are a lot more frameworks to allow you to do that. You can have different pieces that are modular.For example, if I own a shop, Iwant to have a windows phone app, I could get it build by some guys at the other side of the world
  • Microsoft was also feeling those changes. They really needed to embrace this change to DVCS.
  • In fact, Git was built by Linus Torvalds for Linux kernel development in 2005. Mercurial was built by Mackall. the project Actually started a few days after Git.Mercurial got a lot more pressure to be a good product. It was getting more popular because there was more windows support. The reviews by the big players were good.
  • But something changed: Github. They changed the game! They made it as the leading DVCS!
  • - Very efficient model for deployment!- Git can read through HTTP and read and write through SSH.  You push your code, John and Edward push their code, then whoever is in charge of deployment on your team will log onto the server and merge the code into the live environment. Git offers hooks, like “post-receive”, that can perform any kind of action you can throw together- You now have Git for Windows (thanks to Github), and many other tools on the windows platform
  • That made the decision for Microsoft easy, and they went for Git!
  • Before they started implementing Git, they had some principlesThey wanted to do it right.. Not Team Foundation Git!Actually even contributing to the community, and not cheating!
  • One of the main libraries that is used both on the client and on the server by both Microsoft and GitHub.Microsoft joined that project and have contributed to it.
  • This are the top 8 contributors of the project. And the bottom 2 guys are from Microsoft. direct commits from phkelley who has earned that access!Note that they started later that the other guys So they really joined the community.
  • As like the previous TFS versiosn, you can create a Team Project using TFVC.There’s source control provider.. In 2013, you can have a Git backend. Client has a source control providerYou can work local, or just clone another remote repo.There is also Git-TF. That way, you use centralized VC as ‘master’, and you can allow your teams to use Git, and than get that Git commits into TFVC.
  • VisualStudio.com -> Create new Team Projecthttps://github.com/mariorod/SeeGit to VisualStudio.comGit shell (typen)mkdir tempcd tempgit clone -mirror https://github.com/mariorod/SeeGit.gitcd .\SeeGit.git git push --mirror (xyz)Compared to --bare, --mirror not only maps local branches of the source to local branches of the target, it maps all refs (including remote branches, notes etc.) and sets up a refspec configuration such that all these refs are overwritten by a git remote update in the target repository.Web interface – loop everythingAdd a commentShare commit
  • Some basics, I will not show you any branching strategies etc.
  • Init: Initializes a git repository – creates the initial ‘.git’ directory Clone: Makes a Git repository copy from a remote source. Also adds the original location as a remote (use –mirror: replicate the state of an origin repository )Commit: Takes all of the changes written in the index, creates a new commit object pointing to it .. To the local repoFetch: Fetches all the objects from the remote repository that are not present in the local one. (updated the local copy of the remote repo)Pull: Fetches the files from the remote repository and merges it with your local one.  (= git fetch & get merge)Push: Pushes all the modified local objects to the remote repository 
  • You init a repo, you create a branch, you switch to the branch, you add commit, you switch branch and you merge + push
  • They used the libgit2..
  • Connecteren op die nieuwe ‘git’ repoDev-branch maken ( branches – new –dev – publish)Maak een wijziging in Settingsview.xml in de masterCommit + PushOpen web access – history – click op commitWijziging doen, zelfde lijntje op de dev branchCommit + PushMerge van dev-masterConflict resolving
  • There is something like “Team Explorer Everywhere”, by Microsoft, which is basically an Eclipse plugin that connects to to TFS.Version 2013 also adds some Git features. They did not build a “Git integration”, because of Egit, but they created some wizards
  • Maak een TFS build definitieToon settingsToon ookdat je git kuntgebruikenOpen eclipseToon TEEConnecteer op de git repo (via de ‘import’ wizard, alsonderdeel van TEE
  • It are all building blocks.. Use them as you like, combine what you like
  • Easy installation: really easy to create your own repo’s, private!Support: You can call Microsoft, and ask questionsEase of management: web interfaceIntegrated Authentication: NTLM support! Enhanced permissions (within web interface) –> on repo level!ALM integration: important: VS is only a part of the ALM cycle.
  • It’s a completely different product to its core!Now you have the power, the choice!The best for your team, for your product!It’s 100% git, if you don’t want to use it anymore, you can easily transform it to another Git provider
  • What’ really powerfull is the integration with the ALM features of TFS. You can use workitems, builds, …

×