Git Flow

Git Flow

Using Git Flow to solve common Git problems.

71f946b4fdeb8a14e43297b2708e4c3a?s=128

Rodrigo Espinosa Curbelo

August 15, 2014
Tweet

Transcript

  1. GITFLOW Improving the workflow

  2. Projects…

  3. We have to develop…

  4. We have to show progress to the client…

  5. The client need to release...

  6. 3 scenes

  7. Production Staging Development

  8. Scenarios

  9. Production Live Staging Release Candidate Development In progress Scenarios

  10. Branches

  11. Production master Staging sta Development dev Branches

  12. Production Live master Staging Release Candidate sta Development In progress

    dev Servers vs Branches
  13. Each scenario is a world with his own properties and

    behaviours
  14. Production Free of bugs Introduce only “such a tested” feature

    
 Push hot fixes as priority Secure environment No directly interaction
  15. Staging Try features It won’t heart to have bugs
 Fix

    them before merging to master Policy “What is mind? No matter. What is matter? Never mind.”
  16. Development No rules.

  17. Features

  18. –Every client ever. “I just need this shiny thing quickly.”

  19. Work this feature out

  20. • Pull dev, start coding and then pushing the branch.

    • Once in awhile merge dev with sta and deploy. • If something is not working on staging, fix it in that branch. • If everything under staging is working, merge and push to master, deploy to production. Introducing features
  21. • Pull dev, start coding and then pushing the branch.

    • Once in awhile merge dev with sta and deploy. • If something is not working on staging, fix it in that branch. • If everything under staging is working, merge and push to master, deploy to production. Introducing features
  22. OK for Staging
 Not secure enough for Production

  23. • Create a new branch base on staging. • If

    it is needed for collaboration, push the feature branch to origin. • After it is done (and tested), merge it to staging. • Then, delete the feature branch. Introducing features
  24. With this flow the dev branch is not needed anymore

  25. Branches

  26. Branches Production master Staging sta Development feature/*

  27. Do not merge the feature until is complete

  28. Development No rules.

  29. Development Only merge completed features

  30. Without the dev branch we have less drama to worry

    about
  31. Hotfixes

  32. –Johnny Appleseed “Bug report #1024. Fix urgent.”

  33. We have a bug on production

  34. A hotfix is a fix to be done under production.

  35. • A hotfix is a fix to be done under

    production. • Create a new branch base on master. • Code the fix and the merge it to master and sta. • After the two merges, delete the hotfix branch. Introducing hotfixes
  36. If we follow each step, we are using a good

    workflow.
  37. But the creation, merging and deleting of feature and hotfix

    branches can be automatised.
  38. Introducing git-flow

  39. Git flow is an extension for git

  40. It was created to follow this steps in a bliss

  41. Creating a feature with git flow

  42. Creating a feature with git flow git flow feature start

    <FeatureName>
  43. Creating a feature with git flow …code… git add .

    git commit -m “My commit”
  44. Creating a feature with git flow git flow feature finish

    <FeatureName>
  45. Create a new branch Merge it with sta Delete the

    feature branch
  46. Feature collaboration

  47. Feature collaboration To push the branch git flow feature publish

    <FeatureName>
  48. Feature collaboration To pull the branch git flow feature track

    <FeatureName>
  49. Creating a hotfix with git flow

  50. Creating a hotfix with git flow git flow hotfix start

    <FeatureName>
  51. Creating a hotfix with git flow …code… git add .

    git commit -m “My hotfix”
  52. Creating a hotfix with git flow git flow hotfix finish

    <FeatureName>
  53. Conclusions…

  54. Using a dev branch…

  55. None
  56. Use git flow

  57. Will make your release candidate (sta) branch happier

  58. For a less buggy master

  59. Thanks! @espinosacurbelo