Git-Flow

Automate git branching workflow

Presented By:
        Asjad Saboor

        Zubair Farooqui
       

Git-Flow, WHAT?

Set of git extensions to provide high-level repository operations for semantically versioned​ ( aka Vincent Driessen's ) branching model.

The Model

Feature Management, Git Way

Start a feature

$ git checkout -b "myFeature" develop
Switched to a new branch "myFeature"

Finish a feature

$ git checkout develop
Switched to branch 'develop'
$ git merge --no-ff 'myFeature'
Updating ea1b82a..05e9557
(Summary of changes)
$ git branch -d 'myFeature'
Deleted branch 'myFeature' (was 05e9557)
$ git push origin develop 

Does not look too good?

Feature Management,

Git-flow Way

$ git flow feature start "myFeature"
$ git flow feature finish "myFeature"

Summary of actions:
- The feature branch 'feature/myFeature' was merged into 'develop'
- Feature branch 'feature/myFeature' has been removed
- You are now on branch 'develop'



$ git flow feature publish "myFeature"
$ git flow feature track "myFeature"
git flow feature start [-h] [-F] <name> [<base>]
git flow feature finish [-h] [-F] [-r] [-p] [-k] [-D] [-S] [--no-ff] 
<name>

Parameters

Hotfix Management, Git Way

Start a hotfix

Finish a hotfix

$ git checkout -b "hotfix/1.2.1"
$ git checkout master
$ git merge --no-ff "hotfix/1.2.1"
$ git push origin master 
$ git tag -a 1.2.1
$ git checkout develop
$ git merge --no-ff "hotfix/1.2.1"
$ git branch -d "hotfix/1.2.1"
$ git push origin develop 

Does not look too good?

Hotfix Management,

Git-flow Way

$ git flow feature start "1.2.1"
$ git flow feature finish "1.2.1"

Summary of actions:
- Latest objects have been fetched from 'origin'
- Hotfix branch has been merged into 'master'
- The hotfix was tagged '1.2.1'
- Hotfix branch has been back-merged into 'develop'
- Hotfix branch 'hotfix/1.2.1' has been deleted

Release Management, Git Way

Start a release

$ git checkout -b "release/1.2.0"

Finish a release

$ git checkout master
$ git merge --no-ff "release/1.2.0"
$ git push origin master
$ git tag -a 1.2.0
$ git checkout develop
$ git merge --no-ff "release/1.2.0"
$ git push origin develop
$ git branch -d "release/1.2.0"

Release Management,

Git-flow Way

$ git flow release start "1.2.0"
$ git flow release finish "1.2.0"
 
Summary of actions:
- Latest objects have been fetched from 'origin'
- Release branch has been merged into 'master'
- The release was tagged '1.2.0'
- Release branch has been back-merged into 'develop'
- Release branch 'release/1.2.0' has been deleted

$ git flow release publish "1.2.0"
$ git flow release track "1.2.0"
  • Don't forget to push your branches and tags with   
    • git push --follow-tags

How to Install

apt-get install git-flow 
wget -q -O - --no-check-certificate 
https://github.com/nvie/gitflow/raw/develop/contrib/
gitflow-installer.sh | bash

Windows 

Linux 

git flow init
#Output
No branches exist yet. Base branches must be created now.
Branch name for production releases: [master] 
Branch name for "next release" development: [develop] 
How to name your supporting branch prefixes?
Feature branches? [feature/] 
Release branches? [release/] 
Hotfix branches? [hotfix/] 
Support branches? [support/] 
Version tag prefix? [] 

How to Start

Questions?

Made with Slides.com