0% found this document useful (0 votes)
10 views34 pages

Introductiontogitflow 210323093903

This document provides an overview of Git Flow, which is a Git workflow that defines a branching model for managing larger projects. It describes the main branches of develop and master, as well as feature, release, and hotfix branches. The roles of each branch type are defined, and the typical workflows for creating, merging, and finishing each branch are demonstrated both with and without Git Flow extensions.

Uploaded by

Luis Seia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views34 pages

Introductiontogitflow 210323093903

This document provides an overview of Git Flow, which is a Git workflow that defines a branching model for managing larger projects. It describes the main branches of develop and master, as well as feature, release, and hotfix branches. The roles of each branch type are defined, and the typical workflows for creating, merging, and finishing each branch are demonstrated both with and without Git Flow extensions.

Uploaded by

Luis Seia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

Introduction to

Git Flow

Presented By: Mansi Babbar


Lack of etiquette and manners is a huge turn off.

KnolX Etiquettes

Punctuality Feedback
Respect Knolx session timings, you Make sure to submit a constructive
are requested not to join sessions feedback for all sessions as it is
after a 5 minutes threshold post very helpful for the presenter.
the session start time.

Mute Avoid Disturbance


Please keep your window on mute Avoid leaving your window
unmuted after asking a question
Agenda
01 Introduction

02 How Git Flow Works?

03 Feature Branch

04 Release Branch

05 Hotfix Branch

06 Summary

05
07 Demo
7
Introduction
Introduction

● Git Flow is Git workflow design

● Defines a strict branching model designed around the project release

● This provides a robust framework for managing larger projects

● Suited for projects having scheduled release cycle and continuous delivery

● Assigns specific roles to different branches

● Defines how and when the branches should inteact


Introduction

● Command line tool with an installation process

● Git Flow is a wrapper around Git

● After installing git-flow you can use it in your project by executing git flow init

● git flow init is extension of default command git init


How it Works?
Develop & Master
Branches
Develop and Master Branches

Based on two main branches with infinite lifetime:

○ master — this branch contains production code. Stores official release


history
○ develop — this branch contains pre-production code. Serves as an
integration branch for features

○ It is also convenient to tag all commits in the master branch with a


version number
Develop and Master Branches
Develop and Master Branches
Develop and Master Branches
Feature Branch
Feature Branch

● Each new feature should reside in its own branch

● Feature branches use develop as their parent branch

● When a feature is complete, it gets merged back into develop

● Features should never interact directly with master


Feature Branch
Creating a Feature Branch

● Without git-flow extensions:


○ git checkout develop
○ git checkout -b feature_branch

● With git-flow extension:


○ git flow feature start feature_branch
Finishing a Feature Branch

● Without git-flow extensions:


○ git checkout develop
○ git merge feature_branch

● With git-flow extensions:


○ git flow feature finish feature_branch
Release Branch
Release Branch

● Once develop has acquired enough features for a release, fork a


release branch off of develop

● Creating this branch starts the next release cycle, so no new


features can be added after this point

● Allow many minor bug to be fixed and preparation of meta-data


for a release

● Must merge into master and develop


Release Branch
Creating a Release Branch

● Without the git-flow extensions:


○ git checkout develop
○ git checkout -b release/0.1.0

● When using the git-flow extensions:


○ $ git flow release start 0.1.0
○ Switched to a new branch 'release/0.1.0'
Finishing a Release Branch

● Without git-flow extensions:

○ git checkout master

○ git merge release/0.1.0

● With git-flow extension:

○ git flow release finish 0.1.0


Hotfix Branch
Hotfix Branch

● Used to quickly patch production releases

● Created to act immediately upon an undesired status of master

● Based on master instead of develop

● Only branch that should fork directly off of master

● As soon as the fix is complete, it should be merged into both


master and develop
Hotfix Branch
Creating a Hotfix Branch

● Without git-flow extensions:

○ git checkout master

○ git checkout -b hotfix_branch

● With git-flow extensions:

○ $ git flow hotfix start hotfix_branch


Finishing a Hotfix Branch

● Without git-flow extensions:


○ git checkout master
○ git merge hotfix_branch
○ git checkout develop
○ git merge hotfix_branch

● With git-flow extension:


○ git branch -D hotfix_branch
○ $ git flow hotfix finish hotfix_branch
Demo
Summary
Summary

Gitflow is one of many styles of Git workflows you and your team
can utilize.

Some key takeaways to know about Gitflow are:


● The workflow is great for a release-based software workflow.
● Gitflow offers a dedicated channel for hotfixes to production.
Advantages

● Ensures a clean state of branches at any given moment in the life cycle of
project
● The branches naming follows a systematic pattern making it easier to
comprehend
● It has extensions and support on most used git tools
● It is ideal when there it needs to be multiple version in production
Disadvantages

● The Git history becomes unreadable

● The master/develop split is considered redundant

● It isn’t recommended when it need to maintain single version in production


Overall Flow of Git Flow

● A develop branch is created from master


● Feature branches are created from develop
● When a feature is complete it is merged into the develop branch
● A release branch is created from develop
● When the release branch is done it is merged into develop and master
● If an issue in master is detected a hotfix branch is created from master
● Once the hotfix is complete it is merged to both develop and master
Thank You !

You might also like