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

The Foundations of Collaboration with GitHub • SIGCSE 2014

The Foundations of Collaboration with GitHub • SIGCSE 2014

Matthew McCullough

March 08, 2014
Tweet

More Decks by Matthew McCullough

Other Decks in Programming

Transcript

  1. A foundation of collaboration
    presented to the delegates of SIGCSE 2014
    Version control with

    View Slide

  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

    View Slide

  3. http://oreil.ly/ogitvid

    View Slide

  4. http://amzn.to/oreillygit

    View Slide

  5. Version Control
    A refreshed approach to VCS

    View Slide

  6. View Slide

  7. Open Source

    View Slide

  8. bash scripts ☛ C code

    View Slide

  9. is not a
    slightly better

    View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. http://git-scm.com

    View Slide

  14. Starting Up
    Creating a repository

    View Slide

  15. Get a GitHub account.

    View Slide

  16. Get a GitHub account.
    http://github.com/join

    View Slide

  17. Create a new repo(sitory).

    View Slide

  18. Add a file.

    View Slide

  19. View the commit history (timeline).

    View Slide

  20. Make changes to the file.

    View Slide

  21. Repo Creation
    Local and remote initialization simplicity

    View Slide

  22. # Green field project!
    $ git init newproject!
    $ cd newproject!
    # ...start coding

    View Slide

  23. or if you already have source code

    View Slide

  24. # Legacy project tree!
    $ cd existingproject!
    $ git init!
    !
    # Add all the code!
    $ git add .!
    $ git commit -m”Initial import”


    View Slide

  25. ‣ Blob
    ‣ Tree
    ‣ Commit
    ‣ Tag

    View Slide

  26. 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



    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

    View Slide

  27. Collaborating
    Two authors

    View Slide

  28. Make simultaneous changes to the file.

    View Slide

  29. Collaborating Redux
    Untrusted collaborators

    View Slide

  30. Untrusted changes to the file.

    View Slide

  31. Changelist
    Three stage thinking

    View Slide

  32. Working Staging Repo
    add
    commit
    edit

    View Slide

  33. View Slide

  34. ‣shopping cart
    ‣ put things in
    ‣ take things out
    ‣ purchase at register

    View Slide

  35. 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

    View Slide

  36. Workspaces
    The power of simple branch toggling

    View Slide

  37. Local Remote Upstream

    View Slide

  38. # Creating a branch!
    git branch

    View Slide

  39. RELEASE_1.0 HEAD
    bug979branch
    commit
    c67db
    commit
    9bd21
    commit
    1c2d7
    commit
    8c2d1
    commit
    1bdcd
    commit
    2daa1

    View Slide

  40. What do cheap branches enable?

    View Slide

  41. ‣ Experimentation
    ‣


    View Slide

  42. ‣ Experimentation
    ‣ Safe experimentation

    View Slide

  43. Better reuse of units of work

    View Slide

  44. Work Models
    Enabling different development styles

    View Slide

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

    View Slide

  46. Local Remote Upstream
    Integ
    Product
    Integ
    Product
    Integ
    Product

    View Slide

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

    View Slide

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

    View Slide

  49. Central
    Repo
    C e n t r a l i z e d

    View Slide

  50. Blessed
    Repo
    D i c t a t o r s h i p

    View Slide

  51. Certified
    Repo Development Repo
    t e g r a t i o n M a n a g e d
    Continuous

    Integration

    Server

    View Slide

  52. C u s t o m + P u b l i c C o n t r i b
    Customized
    ☚ Private Public ☛
    GitHub

    View Slide

  53. Mirror
    Development Repo
    M i r r o r e d
    Mirror
    Certified
    Repo

    View Slide

  54. Client Apps
    GUIs and other front-ends

    View Slide

  55. http://windows.github.com

    View Slide

  56. http://windows.github.com

    View Slide

  57. http://mac.github.com

    View Slide

  58. http://mac.github.com

    View Slide

  59. Remotes
    Bandwidth and geographic challenges

    View Slide

  60. Local Remote Upstream

    View Slide

  61. Local Remote Upstream

    View Slide

  62. Local Remote Upstream

    View Slide

  63. data from http://whygitisbetterthanx.com/#git-is-fast
    Init
    git svn
    Status
    git svn
    Diff
    git svn
    Tag
    git svn
    Log
    git svn
    Commit (Lg)
    git svn
    Commit (Sm)
    git svn
    Branch
    git c svn c
    Speed

    View Slide

  64. Local Remote Upstream
    commit
    fetch
    push
    clone clone clone
    push
    pull pull pull

    View Slide

  65. Commit
    Push
    Pull

    View Slide

  66. Commit
    Push
    Pull

    View Slide

  67. Commit
    Push
    Pull

    View Slide

  68. Integration
    CI, scripting, and hooks

    View Slide

  69. View Slide

  70. "This is so important, we can't entrust
    it to automation. We need our top
    developer to supervise it."

    View Slide

  71. continuous integration servers
    jenkins
    travis ci
    circleci
    buildhive

    View Slide

  72. View Slide

  73. View Slide

  74. View Slide

  75. View Slide

  76. View Slide

  77. Summary
    The Git and GitHub ecosystem

    View Slide

  78. [email protected]
    education.github.com
    @matthewmccull
    Q&A

    View Slide

  79. • http://education.github.com
    [email protected]
    • http://git-scm.com/book
    • http://training.github.com
    Resources

    View Slide