Save 37% off PRO during our Black Friday Sale! »

Even (Git) flow

Even (Git) flow

For the "know your tools" series: let's study the pros and cons of the different GIT workflows and when to apply them, through the story of Eddie, a developer with a constantly evolving project.

E24c43af87059e1e5602320847b2070d?s=128

Antonello D'Ippolito

November 28, 2018
Tweet

Transcript

  1. Even (GIT) flow a.k.a the story of Eddie

  2. Hello! I’m Antonello D’Ippolito Twitter, GitHub: @antodippo DOING -> VONQ

    (NL) 2
  3. Even (GIT) flow | @antodippo | November 2018 Eddie and

    his project ➢ Eddie starts a new project, alone ➢ He decides to version with Git ➢ The project become bigger ➢ The team become bigger ➢ Which Git workflow will he use?
  4. Centralized workflow

  5. Even (GIT) flow | @antodippo | November 2018 Centralized workflow

    ➢ Good for who’s transitioning from SVN ➢ Just one branch, master ➢ Just one dev, so no conflicts
  6. Even (GIT) flow | @antodippo | November 2018 Centralized workflow

    master
  7. Even (GIT) flow | @antodippo | November 2018 Centralized workflow

    Conflicts! Mike
  8. Even (GIT) flow | @antodippo | November 2018 Centralized workflow

    master local Eddie’s master ➢ Mike starts working on the repository ➢ Eddie is working on the same commit ➢ Mike pushes a new commit on master ➢ Eddie works on the same file as Mike
  9. Feature branch workflow

  10. Even (GIT) flow | @antodippo | November 2018 Feature branch

    workflow ➢ Every feature is isolated in its own branch ➢ Conflicts must be solved in feature branch ➢ When finished it will be merged in master ➢ Eddie can control what’s going on with pull requests
  11. Even (GIT) flow | @antodippo | November 2018 Feature branch

    workflow master Mike’s feature merge/rebase pull request
  12. Even (GIT) flow | @antodippo | November 2018 Feature branch

    workflow Application must be deployed!
  13. Feature branch workflow and continuous delivery

  14. Even (GIT) flow | @antodippo | November 2018 Continuous delivery

    workflow ➢ The application must be delivered in production in short cycles, with new features and bug fixing ➢ There will be many environments (development, staging and production) ➢ Anything on master branch must be deployable in production at anytime
  15. Even (GIT) flow | @antodippo | November 2018 Continuous delivery

    workflow ➢ One “integration” branch for each environment (develop, stage, master) ➢ New feature (or hotfix) branches start from master ➢ A feature (or hotfix) branch can be merged in one of the integration branches ➢ When a feature (or hotfix) branch is ready for production there will be a pull request to master
  16. Even (GIT) flow | @antodippo | November 2018 Continuous delivery

    workflow master feature develop stage merge/rebase pull request
  17. Even (GIT) flow | @antodippo | November 2018 Continuous delivery

    workflow ➢ Start a new branch always from master? ➢ Pull requests to environment branches too? ?
  18. Even (GIT) flow | @antodippo | November 2018 Continuous delivery

    workflow X
  19. “ We will have fixed release cycle, and we will

    maintain n releases
  20. Gitflow workflow

  21. Even (GIT) flow | @antodippo | November 2018 Gitflow workflow

    ➢ Made popular by Vincent Driessen (nvie) ➢ Suitable for fixed releases cycle projects ➢ Specific role for each branch ◦ develop and master ◦ feature/hotfix branches ◦ release branches ➢ Command line tool: https://github.com/nvie/gitflow
  22. Even (GIT) flow | @antodippo | November 2018 Gitflow workflow

    master contains the release history, with tags develop contains the complete history, and it’s the integration branch for new features feature branches branch off of develop are merged back into develop
  23. Even (GIT) flow | @antodippo | November 2018 Gitflow workflow

    release branches branch off of develop when a release is (almost) ready are merged into master and tagged when is ready hotfix branches branch off of master are merged into develop (or the release branch) are merged into master (tagging)
  24. Even (GIT) flow | @antodippo | November 2018 Gitflow workflow

    https://medium.com/devsondevs/gitflow-workflow-continuous-integration-continuous-delivery-7f4643abb64f
  25. Even (GIT) flow | @antodippo | November 2018 Mike new

    feature and bug fixing process: 1. Mike branches feature/new-feature off of develop 2. Mike works on his branch getting updates from develop sometimes 3. Mike submit a PR to develop and Eddie merges the PR 4. When the new release is almost ready, Eddie branches off release/1.x of develop 5. Eddie merges release/1.x to master tagging with the release number 6. After some time, Eddie report a new bug to Mike 7. Mike branches hotfix/new-bug off of master 8. Eddie merges hotfix/new-bug into master, tagging 9. Eddie merges the hotfix/new-bug into develop and release/1.x Gitflow workflow
  26. Even (GIT) flow | @antodippo | November 2018 Gitflow workflow

    ➢ Hotfix must PR to master? ➢ Is develop a release branch? ➢ When release branches must be deleted? ?
  27. “ We must open source this project!

  28. Bonus: forking workflow

  29. Even (GIT) flow | @antodippo | November 2018 Forking workflow

    ➢ Developers who wants to contribute fork the main repository, instead of cloning ➢ They start a new feature branch in their forked repository ➢ They make a PR to the original repository ➢ Eddie merges the PR in the original repository ➢ Developers pull the changes in their forked repository
  30. Even (GIT) flow | @antodippo | November 2018 Thanks!