Introduction to Git

348 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introduction to Git

  1. 1. GitDaniele Giunchi
  2. 2. Summary• SCM, VCS Terminology• SCM Models• History• Git Specs• Branching• Merging• Rebasing• Github• Git as Workflow Generator• Proposed Workflow for B3CNovember 2011 Presentation B3C
  3. 3. SMC, VCS Terminology• SMC -> Source Control Management• VCS -> Version Control System• CVS -> Concurrent Version System (App)• SVN -> Subversion (App)• Git -> is Git! (App)November 2011 Presentation B3C
  4. 4. Let’s dive into Git! no git user git userNovember 2011 Presentation B3C
  5. 5. SCM Models• Local Control Version Systems• Centrilized Control Version Systems• Distributed Control Version SystemsNovember 2011 Presentation B3C
  6. 6. Local Control Version SystemsNovember 2011 Presentation B3C
  7. 7. Local Control Version Systems• A directory in your filesystem!• A database• SCCS (1972)• RCS Revision Control System (1982)• PVCS (1985)November 2011 Presentation B3C
  8. 8. Centrilized Control Version SystemsNovember 2011 Presentation B3C
  9. 9. Centrilized Control Version Systems• CVS (1990)• SVN (2000)• ClearCase (1992)• Visual SourceSafe (1994)• Perforce (1995)• Rational Team Concert (2008)November 2011 Presentation B3C
  10. 10. Distributed Control Version SystemsNovember 2011 Presentation B3C
  11. 11. Distributed Control Version SystemsGit (2005)Mercurial (2005)Bazaar (2011)Bitkeeper (1998)November 2011 Presentation B3C
  12. 12. History• Linux kernel (1991 - …)• Free Lic. Bitkeeper (2oo2 – 2005)• Git birth (2005)Author : Linus TorvaldsWritten: C , Bourne Shell, PerlLicence: GNU GPLNovember 2011 Presentation B3C
  13. 13. Hail Linus!November 2011 Presentation B3C
  14. 14. Current Maintenance Chief! Junio HamanoNovember 2011 Presentation B3C
  15. 15. Characteristics• Speed• Simple design• Strong support for non-linear development (thousands of parallel branches)• Fully distributed• Able to handle large projects• PortableLook at http://whygitisbetterthanx.comNovember 2011 Presentation B3C
  16. 16. Git Specs: Snapshots Not DifferencesNovember 2011 Presentation B3C
  17. 17. Git Specs: Snapshots Not DifferencesNovember 2011 Presentation B3C
  18. 18. Git Specs: Speed? Integrity?• Git operates locally• Git has integrity: SHA1Secure Hash Algorithm (40 ASCII chars)1f8a690b7366a2323e2d5b045120da7e93896f471f8a690November 2011 Presentation B3C
  19. 19. Git Specs: The Three States• File can be committed, modified, and stagedNovember 2011 Presentation B3C
  20. 20. Git Specs: Recording ChangesNovember 2011 Presentation B3C
  21. 21. Git Specs: Add/Commit/PushNovember 2011 Presentation B3C
  22. 22. Git Specs: A GUI please!!!!November 2011 Presentation B3C
  23. 23. How Git storages dataNovember 2011 Presentation B3C
  24. 24. After some commits…November 2011 Presentation B3C
  25. 25. …and now define “Branch”• A branch in Git is simply a lightweight movable pointer to one of these commits.November 2011 Presentation B3C
  26. 26. …and now Branch!November 2011 Presentation B3C
  27. 27. … need a pointer to the snapshot!November 2011 Presentation B3C
  28. 28. … and change the current branch…November 2011 Presentation B3C
  29. 29. … suppose we achieve this graph …November 2011 Presentation B3C
  30. 30. … and then commit into master…November 2011 Presentation B3C
  31. 31. Toward The MergeNovember 2011 Presentation B3C
  32. 32. Toward The MergeNovember 2011 Presentation B3C
  33. 33. Toward The MergeNovember 2011 Presentation B3C
  34. 34. Toward The MergeNovember 2011 Presentation B3C
  35. 35. The Merge! Fast Forward Merge…November 2011 Presentation B3C
  36. 36. Toward another Merge…November 2011 Presentation B3C
  37. 37. Toward another Merge…November 2011 Presentation B3C
  38. 38. The Merge! Three-way Merge…November 2011 Presentation B3C
  39. 39. Rebase … What the hell ????November 2011 Presentation B3C
  40. 40. OK…stop with TheoryNovember 2011 Presentation B3C
  41. 41. Github: base repositoryNovember 2011 Presentation B3C
  42. 42. Git as Workflow Generator• Git has access policies for the repositories• Easy creation of branches=> Creation of a WorkflowNovember 2011 Presentation B3C
  43. 43. B3C Workflow• develop branch• master branch• feature/topic branches• release branches• hotfix branchesNovember 2011 Presentation B3C
  44. 44. Workflow ModelNovember 2011 Presentation B3C
  45. 45. master - developNovember 2011 Presentation B3C
  46. 46. Feature branchesNovember 2011 Presentation B3C
  47. 47. Hotfix branchesNovember 2011 Presentation B3C
  48. 48. References• http://git-scm.com/• http://www.ndpsoftware.com/git-cheatsheet.html• http://gitimmersion.com/• ProGitNovember 2011 Presentation B3C
  49. 49. Coming soon… Hands on session!November 2011 Presentation B3C

×