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

Agile Australia 2014 - Git Workflows

Agile Australia 2014 - Git Workflows

Stefan Saasen

June 18, 2014
Tweet

More Decks by Stefan Saasen

Other Decks in Programming

Transcript

  1. Cheap local branching Full local history Speed Staging area prominent

    in Open Source Huge community You heard has Superior Merging Much faster than svn Distributed cryptographic integrity
  2. Fully decentralized Anarchy I do my thing I do my

    thing, too ANARCHY here’s mine, who tells john? look ma, a goat!
  3. +

  4. upcoming Release ? Can we still fix a bug for

    the Feature Is the code for that complete?
  5. upcoming Release ? Can we still fix a bug for

    the Feature Is the code for that complete? for the current version? Hotfix How do we do a
  6. upcoming Release ? Can we still fix a bug for

    the Feature Is the code for that complete? for the current version? Hotfix How do we do a Reviewed Has everyone the code for this feature ?
  7. Working on features in parallel master Feature #1 Feature #2

    m m m •Always with local branches •With shared branches: After review, before merging
  8. Working on features in parallel master Feature #1 Feature #2

    m m m •Always with local branches •With shared branches: After review, before merging •Mostly a non-issue for short lived branches when updates from master are not required
  9. master is in production 1 staging is the next version

    2 promoted from staging, can receive hot-fixes
  10. master is in production 1 staging is the next version

    new features off staging 2 3 promoted from staging, can receive hot-fixes
  11. master is in production 1 staging is the next version

    new features off staging 2 3 with branch names like: username/ISSUE-KEY-summary promoted from staging, can receive hot-fixes
  12. staging master feature-2 3. Continuous delivery workflow m feature-1 m

    m R H release to production = merge master In Production m
  13. staging master feature-2 3. Continuous delivery workflow m feature-1 m

    m R H only merges release to production = merge master In Production m
  14. one branch per feature 1 one branch per bugfix long

    running stable branches 2 3 master is alpha/RC status 4
  15. 2.2 2.1 Bugfix Automatically merging release branches 2.1.5-SNAPSHOT 2.1.4 $>

    git checkout stable-2.2 $> git merge -s ours stable-2.1
  16. 2.2 2.1 Bugfix Automatically merging release branches merge commit, content

    discarded $> git checkout stable-2.2 $> git merge -s ours stable-2.1
  17. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch:
  18. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline
  19. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Release branch
  20. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Release branch
  21. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Never Release branch
  22. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Never Less stable than its baseline Release branch
  23. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Never Less stable than its baseline Release branch Feature branches
  24. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Never Less stable than its baseline When code complete Release branch Feature branches
  25. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Never Less stable than its baseline When code complete Continually Release branch Feature branches
  26. The merge protocol The secret sauce When a branch is:

    Change flows from 
 branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Never Less stable than its baseline When code complete Continually Release branch Feature branches Credit: Laura Wingerd - The Flow of change
  27. The merge protocol The secret sauce Release Branch Master Merge

    continually http:/ /bit.ly/branch-based-workflows
  28. The merge protocol The secret sauce Release Branch Master Merge

    continually Never merge! http:/ /bit.ly/branch-based-workflows
  29. The merge protocol The secret sauce Release Branch Master Merge

    continually Backport single changes using git cherry-pick Never merge! http:/ /bit.ly/branch-based-workflows
  30. ! ! ! Branching Model Adopt Git Practices ! !

    ! ! ! ! ! ! Collaboration Model
  31. ! ! ! Branching Model Adopt Git Practices ! !

    ! ! ! ! ! ! Collaboration Model Centralized
  32. ! ! ! Branching Model Adopt Git Practices ! !

    ! ! ! Product workflow ! ! ! Collaboration Model Centralized
  33. ! ! ! Branching Model Adopt Git Practices ! !

    ! ! ! Product workflow Continuous delivery workflow ! ! ! Collaboration Model Centralized
  34. ! ! ! Branching Model Adopt Git Practices ! !

    ! ! ! Product workflow Continuous delivery workflow ! ! ! Collaboration Model Centralized Merge protocol
  35. ! ! ! Branching Model Adopt Git Practices ! !

    ! ! ! Product workflow Continuous delivery workflow Build automatically, but leave knobs! ! ! ! Collaboration Model Centralized Merge protocol
  36. ! ! ! Branching Model Adopt Git Practices ! !

    ! ! ! Product workflow Continuous delivery workflow Embrace PR Build automatically, but leave knobs! ! ! ! Collaboration Model Centralized Merge protocol
  37. ! ! Thank you for your ! attention! ! !

    ! ! @stefansaasen ! ! [email protected] ! www.atlassian.com