$30 off During Our Annual Pro Sale. View Details »

Git and GitHub Workflows at the Utah JUG

Git and GitHub Workflows at the Utah JUG

The Git version control system and GitHub collaboration platform offer a myriad of innovative and classic development workflow options. The wide range of opinions about these on the Internet can make it challenging to nimbly make wise Git workflow decisions for your team's next project.

In this presentation, Matthew will provide a tour of successful workflow patterns harvested from 7 years of studying and working with open source projects, small and large scale businesses, and governmental agencies employing everything from waterfall to fully agile processes. Flows will feature live demonstrations of the supporting Git and GitHub commands.

A little guidance can go a long way in helping you navigate the new world of distributed version control, and this talk will help you make informed choices of the Git features you'll use, the branching patterns you'll leverage, and the way you will integrate your chosen pattern with your team's development practices.

This presentation was given to the Utah Java Users Group on August 21st, 2014.

Matthew McCullough

August 21, 2014
Tweet

More Decks by Matthew McCullough

Other Decks in Programming

Transcript

  1. Git and GitHub Workflows
    Information to aid your VCS and branching decisions
    !
    a discussion with Matthew McCullough

    View Slide

  2. [email protected]
    @matthewmccull
    matthewmccullough
    !

    View Slide

  3. software development

    View Slide

  4. decisions…
    decisions…
    decisions…
    decisions…

    View Slide

  5. decisions…
    decisions…
    decisions…
    decisions…
    Platform
    Language
    IDE
    Process

    View Slide

  6. but the initial decisions are…

    View Slide

  7. VCS decisions

    View Slide

  8. basis for other decisions

    View Slide

  9. de-centralized
    centralized

    View Slide

  10. Git and GitHub Workflows
    GitHub Flow
    Git Flow
    Rebase It
    Squash It
    Linear
    Fast iterations
    Git Project Workflow
    Flow Types
    Aims
    Long-lived release branches
    Maintenance
    Commands
    rebase master
    merge --squash
    rebase -i
    commit —amend
    pull -r
    bisect
    Easy regression discovery
    Developer on boarding
    Continuous Integration
    Build all branches
    Version Control UI
    Handles rebased branches?
    Triggers UI updates on merges?
    Pull Requests
    Commit keywords: “fixes #22”
    revert
    Setting up jobs
    Push branch to production
    Chatops
    Deploying to branches
    Reverse merges
    merge master topic
    Deployments API
    GitHub Releases API
    Semantic versioning best practices
    Teams
    Solo
    1-5
    5-15
    15-50
    50-150
    150+
    reset --hard
    reset --soft
    rebase --autosquash -i
    GitHub Deployments API
    Centralized
    Decentralized

    View Slide


  11. "
    "
    "
    "
    "
    "
    "
    "

    View Slide


  12. View Slide


  13. #

    View Slide


  14. $

    View Slide

  15. Team decisions

    View Slide

  16. how
    many team members?

    View Slide

  17. 1
    team member?

    View Slide

  18. View Slide

  19. 1 to 5
    team members?

    View Slide

  20. View Slide

  21. 5 to 15
    team members?

    View Slide

  22. 15 to 50
    team members?

    View Slide

  23. 50 to 150
    team members?

    View Slide

  24. 150+
    team members?

    View Slide

  25. View Slide

  26. View Slide

  27. View Slide

  28. View Slide

  29. optimization decisions

    View Slide

  30. optimized for
    fast iterations?

    GitHub Flow

    View Slide

  31. View Slide

  32. master

    View Slide

  33. master
    topic

    View Slide

  34. master
    topic

    View Slide

  35. master
    topic

    View Slide

  36. master
    topic

    View Slide

  37. master
    topic

    View Slide

  38. # ➌

    View Slide

  39. optimized for
    release maintenance?

    Git Flow

    View Slide

  40. Time
    release
    branches master
    develop hotfixes
    feature
    branches
    Feature
    for future
    release
    Major
    feature for
    next release
    Severe bug
    fixed for
    production:
    hotfix 0.2
    Tag
    0.1
    Tag
    0.2
    Incorporate
    bugfix in
    develop

    View Slide

  41. Tag
    1.0
    From this point on,
    “next release”
    means the release
    after 1.0
    Bugfixes from
    rel. branch
    may be
    continuously
    merged back
    into develop
    Only
    bugfixes!
    1.0

    View Slide

  42. command line tooling

    View Slide


  43. #

    View Slide

  44. optimized for
    developer on-boarding

    atomic flow

    View Slide

  45. master

    View Slide

  46. master
    topic

    View Slide

  47. master
    topic

    View Slide

  48. master
    topic

    View Slide

  49. master
    topic

    View Slide

  50. master
    topic

    View Slide


  51. #

    View Slide

  52. optimized for
    clarity & maintenance

    git.git gitworkflows

    View Slide


  53. View Slide

  54. maint
    master
    next
    pu

    View Slide


  55. #

    View Slide

  56. command decisions

    View Slide

  57. $ git merge master

    View Slide

  58. $ git revert

    View Slide

  59. $ git commit --amend

    View Slide

  60. $ git pull -r

    View Slide

  61. $ git rebase master
    $ git rebase -i
    $ git rebase --autosquash -i

    View Slide

  62. $ git merge —squash

    View Slide

  63. $ git bisect start
    $ git bisect good
    $ git bisect bad
    $ git bisect run
    $ git bisect log

    View Slide

  64. $ git reset --hard
    $ git reset --soft
    $ git reset --mixed

    View Slide

  65. So what workflow
    should I chose Matthew?

    View Slide

  66. mix and match

    View Slide

  67. the
    simplest thing that works

    View Slide

  68. [email protected]
    @matthewmccull
    matthewmccullough
    !

    View Slide

  69. [email protected]
    training.github.com
    @githubtraining
    githubtraining
    !

    View Slide