Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tool Development A - Git

635 views

Published on

Appendix A of the lecture Tool Development taught at SAE Institute Hamburg.

Introduction to version control systems, Git and Git Flow.

Published in: Technology
  • Be the first to comment

Tool Development A - Git

  1. 1. Tool Development Appendix A: Git Nick Prühs
  2. 2. Objectives • To get an overview of version control systems in general • To learn how to use Git in a production environment • To understand advanced concepts of branching and merging 2 / 58
  3. 3. Local Version Control 3 / 58
  4. 4. Centralized Version Control 4 / 58
  5. 5. Distributed Version Control 5 / 58
  6. 6. Version Deltas 6 / 58
  7. 7. Version Snapshots 7 / 58
  8. 8. Git Areas 8 / 58
  9. 9. Git Lifecycle 9 / 58
  10. 10. DEMO • Installing Git • Installing SourceTree • Creating a GitHub account • Creating a Git repository • Cloning the repository 10 / 58
  11. 11. DEMO • Check file status • Adding new files • Viewing changes • Staging modified files • Moving files • Removing files 11 / 58
  12. 12. DEMO • Pulling • Commiting changes • Pushing 12 / 58
  13. 13. DEMO • Unstaging files • Reverting files 13 / 58
  14. 14. DEMO • Viewing history • Ignoring files • Tagging 14 / 58
  15. 15. Git Commit Tree 15 / 58
  16. 16. Git Commit & Parents 16 / 58
  17. 17. Git Branch 17 / 58
  18. 18. Git Branches 18 / 58
  19. 19. Git HEAD 19 / 58
  20. 20. Switching Branches 20 / 58
  21. 21. Adding Commits 21 / 58
  22. 22. Switching Branches 22 / 58
  23. 23. Divergent History 23 / 58
  24. 24. Merging Branches 24 / 58
  25. 25. Merging Branches 25 / 58
  26. 26. Origin 26 / 58
  27. 27. Origin 27 / 58
  28. 28. Origin 28 / 58
  29. 29. Hint Split your work up into small, unrelated commits! 29 / 78
  30. 30. Git Commit Messages 30 / 58 • ADDED • CHANGED • REMOVED • FIXED
  31. 31. GitFlow • Originally developed by Vincent Driessen • Assigns very specific roles to different branches, and defines how and when they should interact • Allows merging and branching to be part of your daily workflow 31 / 58
  32. 32. Main Branches • master • origin/master HEAD is always ready for production • develop • origin/develop HEAD always contains the latest delivered development changes • Nightly builds are created from this branch • Whenever considered stable, merged back into master and tagged 32 / 58
  33. 33. Main Branches 33 / 58
  34. 34. Supporting branches • Feature branches • Allow parallel development • Make tracking features easier • Release branches • Help preparing for releases • Hotfix branches • Enable you to quickly fix live problems 34 / 58
  35. 35. Feature Branches • Branch from and merge back into develop • Used for developing new features • Exists while the feature is in development • Will eventually be • Merged back, to include the new feature in the next release, or • Discarded, if the feature should not be included • Never directly interact with the master branch 35 / 58
  36. 36. Feature Branches 36 / 58
  37. 37. Hint Merging with the “no fast-forward” option causes the merge to always create a new commit. This makes tracking of your branches a lot easier! 37 / 78
  38. 38. Release Branches • Branch from develop, and merge back into develop and master • Created when all desired features for the next release have been merged back into develop • Supports preparation of a new production release • Setting up meta-data such as version numbers or database connections • Generating API documentation • Features for the next release can already merge back into develop 38 / 58
  39. 39. Release Branches 39 / 58
  40. 40. Hint Whenever changes are merged back into master, this is a new production release by definition! 40 / 78
  41. 41. Hotfix Branches • Branch from master, and merge back into develop and master • Created when a critical bug in a production release has to be resolved immediately • Other team members can continue working on new features or the next release 41 / 58
  42. 42. Hotfix Branches 42 / 58
  43. 43. Hint Unlike the two main branches, all supporting branches will be merged and removed eventually! 43 / 78
  44. 44. References • Chacon, Straub. Pro Git. 2nd Edition. Apress, December 24, 2014. http://www.git-scm.com/doc • Vincent Driessen. A successful Git branchin model. http://nvie.com/posts/a-successful-git-branching- model/, January 5, 2010. • Atlassian. Gitflow Workflow. https://www.atlassian.com/git/workflows#!workflo w-gitflow, June 2014. 44 / 58
  45. 45. Thank you for your attention! Contact Mail dev@npruehs.de Blog http://www.npruehs.de Twitter @npruehs Github https://github.com/npruehs 45 / 58

×