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 full-size 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 full-size slide

  3. http://oreil.ly/ogitvid

    View full-size slide

  4. http://amzn.to/oreillygit

    View full-size slide

  5. Version Control
    A refreshed approach to VCS

    View full-size slide

  6. bash scripts ☛ C code

    View full-size slide

  7. is not a
    slightly better

    View full-size slide

  8. http://git-scm.com

    View full-size slide

  9. Starting Up
    Creating a repository

    View full-size slide

  10. Get a GitHub account.

    View full-size slide

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

    View full-size slide

  12. Create a new repo(sitory).

    View full-size slide

  13. Add a file.

    View full-size slide

  14. View the commit history (timeline).

    View full-size slide

  15. Make changes to the file.

    View full-size slide

  16. Repo Creation
    Local and remote initialization simplicity

    View full-size slide

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

    View full-size slide

  18. or if you already have source code

    View full-size slide

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


    View full-size slide

  20. ‣ Blob
    ‣ Tree
    ‣ Commit
    ‣ Tag

    View full-size slide

  21. 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 full-size slide

  22. Collaborating
    Two authors

    View full-size slide

  23. Make simultaneous changes to the file.

    View full-size slide

  24. Collaborating Redux
    Untrusted collaborators

    View full-size slide

  25. Untrusted changes to the file.

    View full-size slide

  26. Changelist
    Three stage thinking

    View full-size slide

  27. Working Staging Repo
    add
    commit
    edit

    View full-size slide

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

    View full-size slide

  29. 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 full-size slide

  30. Workspaces
    The power of simple branch toggling

    View full-size slide

  31. Local Remote Upstream

    View full-size slide

  32. # Creating a branch!
    git branch

    View full-size slide

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

    View full-size slide

  34. What do cheap branches enable?

    View full-size slide

  35. ‣ Experimentation
    ‣


    View full-size slide

  36. ‣ Experimentation
    ‣ Safe experimentation

    View full-size slide

  37. Better reuse of units of work

    View full-size slide

  38. Work Models
    Enabling different development styles

    View full-size slide

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

    View full-size slide

  40. Local Remote Upstream
    Integ
    Product
    Integ
    Product
    Integ
    Product

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    Integration

    Server

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  48. Client Apps
    GUIs and other front-ends

    View full-size slide

  49. http://windows.github.com

    View full-size slide

  50. http://windows.github.com

    View full-size slide

  51. http://mac.github.com

    View full-size slide

  52. http://mac.github.com

    View full-size slide

  53. Remotes
    Bandwidth and geographic challenges

    View full-size slide

  54. Local Remote Upstream

    View full-size slide

  55. Local Remote Upstream

    View full-size slide

  56. Local Remote Upstream

    View full-size slide

  57. 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 full-size slide

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

    View full-size slide

  59. Commit
    Push
    Pull

    View full-size slide

  60. Commit
    Push
    Pull

    View full-size slide

  61. Commit
    Push
    Pull

    View full-size slide

  62. Integration
    CI, scripting, and hooks

    View full-size slide

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

    View full-size slide

  64. continuous integration servers
    jenkins
    travis ci
    circleci
    buildhive

    View full-size slide

  65. Summary
    The Git and GitHub ecosystem

    View full-size slide

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

    View full-size slide

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

    View full-size slide