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

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.

Antonello D'Ippolito

November 28, 2018
Tweet

More Decks by Antonello D'Ippolito

Other Decks in Programming

Transcript

  1. 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?
  2. 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
  3. 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
  4. 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
  5. Even (GIT) flow | @antodippo | November 2018 Feature branch

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

    workflow Application must be deployed!
  7. 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
  8. 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
  9. Even (GIT) flow | @antodippo | November 2018 Continuous delivery

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

    workflow ➢ Start a new branch always from master? ➢ Pull requests to environment branches too? ?
  11. 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
  12. 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
  13. 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)
  14. Even (GIT) flow | @antodippo | November 2018 Gitflow workflow

    https://medium.com/devsondevs/gitflow-workflow-continuous-integration-continuous-delivery-7f4643abb64f
  15. 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
  16. Even (GIT) flow | @antodippo | November 2018 Gitflow workflow

    ➢ Hotfix must PR to master? ➢ Is develop a release branch? ➢ When release branches must be deleted? ?
  17. 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