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

Collaboration patterns with Git and GitHub

Collaboration patterns with Git and GitHub

Video of the talk (en Français) at Nantes JUG on https://www.youtube.com/watch?v=CUsZYzvrKog

Alain Hélaïli

October 13, 2015
Tweet

More Decks by Alain Hélaïli

Other Decks in Technology

Transcript

  1. the best way to build and ship software
    Collaboration patterns with Git & GitHub
    a @helaili - @AlainHelaili - ! [email protected]

    View Slide

  2. View Slide

  3. the best way to build and ship software
    Git
    3
    "
    “////////////////////////////////////////////////////////////////
    GIT - THE STUPID CONTENT TRACKER
    ////////////////////////////////////////////////////////////////
    "GIT" CAN MEAN ANYTHING, DEPENDING ON YOUR MOOD.
    - RANDOM THREE-LETTER COMBINATION THAT IS PRONOUNCEABLE, AND NOT ACTUALLY USED BY ANY
    COMMON UNIX COMMAND. THE FACT THAT IT IS A MISPRONUNCIATION OF "GET" MAY OR MAY NOT BE
    RELEVANT.
    - STUPID. CONTEMPTIBLE AND DESPICABLE. SIMPLE. TAKE YOUR PICK FROM THE DICTIONARY OF
    SLANG.
    - "GLOBAL INFORMATION TRACKER": YOU'RE IN A GOOD MOOD, AND IT ACTUALLY WORKS FOR YOU.
    ANGELS SING, AND A LIGHT SUDDENLY FILLS THE ROOM.
    - "GODDAMN IDIOTIC TRUCKLOAD OF SH*T": WHEN IT BREAKS

    View Slide

  4. the best way to build and ship software
    Git
    4
    "
    • Started by Linus Torvalds 2005 (search “torvalds git” on youtube)
    • Easy branching and merging - content oriented, remembers origin
    • Small and fast - local operations, smaller repos
    • Distributed - VCS on my laptop, full copy incl. history
    • Data assurance - sha1, gpg
    • Staging area - crafted, meaningful commits
    • Free and open source - did you read the first line of this slide?

    View Slide

  5. the best way to build and ship software
    Git lingo
    5
    "
    # Repo
    % Clone
    & Pull
    ' Push
    ( Commit
    ) Diff
    * Branch
    + Merge
    ,-./ Rebase
    Disclaimer
    The views and opinions expressed here are those of the
    authors and do not necessarily reflect the official policy or
    position of GitHub or anybody else on the planet, including
    actually myself. You might be able to find somewhere
    someone who agrees with this statement, and this person
    would actually be the right one to start debating on this
    topic. I personally do not want to discuss this matter as we
    will never find a common ground.
    0

    View Slide

  6. the best way to build and ship software
    Git Quick Demo
    6
    "

    View Slide

  7. the best way to build and ship software
    An ideal patch flow
    7
    "
    “(0) YOU COME UP WITH AN ITCH. YOU CODE IT UP.
    (1) SEND IT TO THE LIST AND CC PEOPLE WHO MAY NEED TO KNOW ABOUT THE CHANGE.
    (2) YOU GET COMMENTS AND SUGGESTIONS FOR IMPROVEMENTS. YOU MAY EVEN GET THEM IN A "ON
    TOP OF YOUR CHANGE" PATCH FORM.
    (3) POLISH, REFINE, AND RE-SEND TO THE LIST AND THE PEOPLE WHO SPEND THEIR TIME TO IMPROVE
    YOUR PATCH. GO BACK TO STEP (2).
    (4) THE LIST FORMS CONSENSUS THAT THE LAST ROUND OF YOUR PATCH IS GOOD. SEND IT TO THE
    MAINTAINER AND CC THE LIST.
    (5) A TOPIC BRANCH IS CREATED WITH THE PATCH AND IS MERGED TO ‘NEXT', AND COOKED FURTHER
    AND EVENTUALLY GRADUATES TO ‘MASTER'.
    - HTTPS://GITHUB.COM/GIT/GIT/BLOB/MASTER/DOCUMENTATION/SUBMITTINGPATCHES

    View Slide

  8. "
    http://www.wired.com/2012/02/github-2/ Photo : Ariel Zambelich/Wired

    View Slide

  9. "
    Social Coding

    View Slide

  10. the best way to build and ship software
    GitHub key facts
    10
    "
    FOUNDED
    2008
    EMPLOYEES
    345
    UNIVERSITIES
    USING GITHUB
    1,000+
    TOTAL 

    REGISTERED
    USERS
    10M
    TOTAL
    REPOSITORIES
    27M
    PAYING
    ORGANIZATIONS
    >60,000

    View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. "
    Orgs, Teams,
    Collaborators…

    View Slide

  15. View Slide

  16. View Slide

  17. "
    GitHub Flow

    View Slide

  18. Create a Feature Branch

    View Slide

  19. Add commits

    View Slide

  20. Open a Pull Request

    View Slide

  21. Discuss and Review Code

    View Slide

  22. Deploy and Test

    View Slide

  23. Merge with master

    View Slide

  24. "
    Fork & Pull
    Flow

    View Slide

  25. #
    1
    *
    2
    3
    3
    +
    &
    *
    4
    5
    3
    3
    Upstream
    Origin
    Fork

    View Slide

  26. View Slide

  27. #
    1
    *
    2
    3
    3
    +
    &
    *
    4
    5
    3
    3
    Upstream
    Origin
    Create a Feature Branch

    View Slide

  28. View Slide

  29. #
    1
    *
    2
    3
    3
    +
    &
    *
    4
    5
    3
    3
    Upstream
    Origin
    Add commits

    View Slide

  30. #
    1
    *
    2
    3
    3
    +
    &
    *
    4
    5
    3
    3
    Upstream
    Origin
    Open a Pull Request

    View Slide

  31. View Slide

  32. #
    1
    *
    2
    3
    3
    +
    &
    *
    4
    5
    3
    3
    Upstream
    Origin
    Discuss and Review Code

    View Slide

  33. #
    1
    *
    2
    3
    3
    &
    *
    4
    5
    3
    3
    Upstream
    Origin
    Merge
    +

    View Slide

  34. #
    1
    *
    2
    3
    3
    +
    &
    *
    4
    5
    3
    3
    Upstream
    Origin
    Pull from Upstream Master

    View Slide

  35. "
    Dictator
    &
    Lieutenant
    Flow

    View Slide

  36. #
    4
    1
    5
    1
    5
    5
    4
    4 1 1
    1
    1 1
    Dictator
    Lieutenants
    Public
    contributors

    View Slide

  37. #
    4
    1
    5
    1
    5
    5
    4
    4 1 1
    1
    1 1
    Dictator
    Lieutenants
    Public
    contributors
    2 2 2 2
    2
    2
    +

    View Slide

  38. #
    4
    1
    5
    1
    5
    5
    4
    4 1 1
    1
    1 1
    Dictator
    Lieutenants
    Public
    contributors

    View Slide

  39. "
    Secret
    Flow

    View Slide

  40. #
    #
    1 1
    6 6
    4 4
    #
    1 1
    5 5
    2 2 2 2
    git init toplevel

    git submodule add https://octodemo.com/helaili/submodule2.git
    git commit -a -m "Adding submodules”
    git push origin master
    7
    7 7

    View Slide

  41. "
    Git Flow

    View Slide

  42. http://nvie.com/posts/a-successful-git-branching-model/

    View Slide

  43. "
    Code
    Review

    View Slide

  44. View Slide

  45. 1, 2… Some…. All?

    View Slide

  46. View Slide

  47. View Slide

  48. What’s
    new?

    View Slide

  49. View Slide

  50. View Slide

  51. "
    "
    hubot

    View Slide

  52. "
    Questions?

    View Slide