Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git for the Uninitiated

Git for the Uninitiated

A presentation delivered by Matthew McCullough at DevNexus 2013 in Atlanta, GA, USA.


Matthew McCullough

February 18, 2013


  1. A collaborative reboot for version control GIT FOR THE UNINITIATED

  2. Matthew.... @matthewmccull ‣Open source contributor ‣O'Reilly Git Video Co-instructor ‣Co-Author

    of O'Reilly's Git book ‣5-year Git trainer ‣Instructor at GitHub
  3. http://oreil.ly/ogitvid

  4. http://amzn.to/oreillygit

  5. None
  6. None
  7. None
  8. None
  9. Version Control A refreshed approach to VCS

  10. None
  11. Open Source

  12. bash scripts ☛ C code

  13. is not a slightly better

  14. None
  15. None
  16. None
  17. http://git-scm.com

  18. Starting Up Creating a repository

  19. Get a GitHub account.

  20. Get a GitHub account. http://github.com/signup/free

  21. Create a new repo(sitory).

  22. Add a file.

  23. View the commit history (timeline).

  24. Make changes to the file.

  25. Repo Creation Local and remote initialization simplicity

  26. # Green field project $ git init newproject $ cd

    newproject # ...start coding
  27. or if you already have source code

  28. # Legacy project tree $ cd existingproject $ git init

    # Add all the code $ git add . $ git commit -m”Initial import”
  29. ‣Blob ‣Tree ‣Commit ‣Tag

  30. tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob:

    8d162 logo.jpg blob: 51d22 draw.js 7e8b1 commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob <html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  31. Collaborating Two authors

  32. Make simultaneous changes to the file.

  33. Collaborating Redux Untrusted collaborators

  34. Untrusted changes to the file.

  35. Changelist Three stage thinking

  36. Working Staging Repo add commit edit

  37. None
  38. ‣shopping cart ‣put things in ‣take things out ‣purchase at

  39. v1 v2 v3 v4 File A File B File C

    File A File B File B File C v5 File A File B File B File A File A File C File C File C
  40. Workspaces The power of simple branch toggling

  41. Local Remote Upstream

  42. # Creating a branch git branch <BRANCHNAME>

  43. RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit

    8c2d1 commit 1bdcd commit 2daa1
  44. What do cheap branches enable?

  45. ‣Experimentation ‣

  46. ‣Experimentation ‣Safe experimentation

  47. Better reuse of units of work

  48. Work Models Enabling different development styles

  49. product v1.0 integration story1 story2 v1.5 integration story3

  50. Local Remote Upstream Integ Product Integ Product Integ Product

  51. Local Remote Upstream Idea Story Feature Feature Feature Integ Product

    Integ Product Integ Product
  52. Local Remote Upstream Idea Story Feature Feature Feature Integ Product

    Integ Product Integ Product
  53. Central Repo C e n t r a l i

    z e d
  54. Blessed Repo D i c t a t o r

    s h i p
  55. Certified Repo Development Repo n t e g r a

    t i o n M a n a g e d Continuous Integration Server
  56. C u s t o m + P u b

    l i c C o n t r i b Customized ☚ Private Public ☛ GitHub
  57. Mirror Development Repo M i r r o r e

    d Mirror Certified Repo
  58. Client Apps GUIs and other front-ends

  59. http://windows.github.com

  60. http://windows.github.com

  61. http://mac.github.com

  62. http://mac.github.com

  63. Remotes Bandwidth and geographic challenges

  64. Local Remote Upstream

  65. Local Remote Upstream

  66. Local Remote Upstream

  67. data from http://whygitisbetterthanx.com/#git-is-fast git svn Init git svn Status git

    svn Diff git svn Tag git svn Log git svn Commit (Lg) git svn Commit (Sm) git c svn c Branch Speed
  68. Local Remote Upstream commit fetch push clone clone clone push

    pull pull pull
  69. Commit Push Pull

  70. Commit Push Pull

  71. Commit Push Pull

  72. Integration CI, scripting, and hooks

  73. None
  74. "This is so important, we can't entrust it to automation.

    We need our top developer to supervise it."
  75. continuous integration servers jenkins travis ci circleci buildhive

  76. None
  77. None
  78. None
  79. None
  80. None
  81. Summary The Git and GitHub ecosystem

  82. training@github.com github.com/training @githubtraining githubtraining Q&A

  83. http://learn.github.com

  84. http://teach.github.com

  85. Why Git?

  86. None
  87. None
  88. I'm an egotistical bastard, and I name all my projects

    after myself. First Linux, now git. -Linus Torvalds “ Credits: Martin Streicher, http://en.wikipedia.org/wiki/File:Linus_Torvalds.jpeg
  89. CVS Subversion PVCS Perforce Clear Case Source Safe RCS Folders

  90. Small Footprint

  91. Simple

  92. Powerful

  93. Composable

  94. Setting Up Git

  95. binaries on your $PATH

  96. http://help.github.com

  97. None
  98. Using Git

  99. Create a Git repository

  100. None
  101. http://git-scm.com/book

  102. http://teach.github.com

  103. http://help.github.com

  104. Git GUIs

  105. None
  106. https://github.com/github/GitPad

  107. None
  108. http://eclipse.org/egit/

  109. None
  110. Using GitHub

  111. None
  112. ‣Social coding ‣Fork and pull model

  113. Blessed Repo

  114. None
  115. ‣Web-based image diff ‣Lightweight issue tracking

  116. None
  117. None
  118. https://enterprise.github.com

  119. None
  120. Q&A

  121. @matthewmccull training@github.com training.github.com