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

Introduction to Gitflow

Abid Jamil
September 16, 2021

Introduction to Gitflow

Abid Jamil

September 16, 2021
Tweet

More Decks by Abid Jamil

Other Decks in Programming

Transcript

  1. Working with source code What we do • Copy &

    Paste file and folder s • Carry code on external drive s • Backup using manual copies • Forget to make cop y • Hard to manage copie s • Hard to share version b/w colllaborator s • No Descriptive History Problems
  2. Introduction to Git & Github
 
 Git is a version

    control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories. Git is a software. GitHub is a service.
  3. Introduction to Gitflow
 
 Gitflow is really just an abstract

    idea of a Git workflow. It helps with continuous software development and implementing DevOp s The Gitflow Workflow defines a strict branching model by Vincent Driessen designed around the project release .
  4. Introduction to Gitflow
 
 Gitflow is ideally suited for projects

    that have a scheduled release cycle and for the DevOps best practice of continuous delivery. It assigns very specific roles to different branches and defines how and when they should interact.
  5. How It Works? Master Branch : The master branch contains

    production code and it stores the official release history . Develop Branch : The develop branch contains pre-production code and serves as an integration branch for features.
  6. How It Works? When using the git-flow extension library, executing

    git flow init on an existing repo will create the develop branch.
  7. Branching Model Feature Branch Each new feature should reside in

    its own branch, which can be pushed to the central repository for backup/collaboration. But, instead of branching off of master, feature branches use develop as their parent branch.
  8. Feature Branch Creating a Feature Branc h Without git-flow extensions

    : •git checkout develo p •git checkout -b feature_branc h With git-flow extension : •git flow feature start feature_branch
  9. Feature Branch Finishing a Feature Branc h Without git-flow extensions

    : • git checkout develo p • git merge feature_branc h With git-flow extension : • git flow feature start feature_branch
  10. Branching Model Release Branch Once develop has acquired enough features

    for a release (or a predetermined release date is approaching), you fork a release branch off of develop. May branch off from develop and must merge into master and develop.
  11. Release Branch Creating a Release Branc h Without git-flow extensions

    : •git checkout develo p •git checkout -b release/0.1. 0 With git-flow extension : •git flow release start 0.1.0
  12. Release Branch Finishing a Release Branc h Without git-flow extensions

    : • git checkout maste r • git merge release/0.1. 0 With git-flow extension : • git flow release finish 0.1.0
  13. Branching Model Hotfix Branch Maintenance or “hotfix” branches are used

    to quickly patch production releases. Hotfix branches are necessary to act immediately upon an undesired status of master. Hotfix branches are a lot like release branches and feature branches except they’re based on master instead of develop.
  14. Hotfix Branch Creating a Hotfix Branc h Without git-flow extensions

    : •git checkout maste r •git checkout -b hotfix_branch With git-flow extension : •git flow hotfix start hotfix_branch
  15. Hotfix Branch Finishing a Hotfix Branc h Without git-flow extensions

    : • git checkout maste r • git merge hotfix_branc h • git checkout develo p • git merge hotfix_branch With git-flow extension : • git flow hotfix finish hotfix_branch
  16. Summary The workflow is great for a release-based software workflow

    . Gitflow offers a dedicated channel for hotfixes to production
  17. Overall Flow of GitFlow
 • A develop branch is created

    from maste r • Feature branches are created from develo p • When a feature is complete it is merged into the develop branc h • A release branch is created from develo p • When the release branch is done it is merged into develop and maste r • If an issue in master is detected a hotfix branch is created from maste r • Once the hotfix is complete it is merged to both develop and master