SlideShare a Scribd company logo
Git Flow
A Git branching model
Why git?
1. Git is Fast
2. Git is Small
3. Distributed
4. GitHub
5. Git is the new standard
6. Easy to Learn( 21 commands)
7. Cheap Local Branching
Decentralized but centralized
GIT FLOW
The Main Branches
The central repo holds two main
branches with an infinite lifetime:
1. master(always reflects a production-ready state)
2. develop( testable code, without any incomplete
features or code)
Supporting Branches
1. Supporting branches are used for:
a. parallel development between team members
b. ease tracking of features
c. prepare for production releases
d. assist in quickly fixing live production problems
2. These branches always have a limited lifetime
Type of branches:
1. Feature branches
2. Release branches
3. Hotfix branches
4. Issue Branches
5. Your choice
Feature Branches
Branch off from: develop
Must merge back into: develop
Branch naming convention: feature-*
1. used to develop new features for the upcoming or a
distant future release
2. exists as long as the feature is in development
3. can be merged back into develop ( to add new
features)
4. or discarded (in case of a disappointing experiment)
5. Feature branches can be local branches or pushed to
origin if more developers are working on same feature
Release Branches
Branch off from: develop
Must merge back into: develop and master
Branch naming convention: release-*
1. preparation of a new production release
2. allow for minor bug fixes
3. meta-data for a release (version number, build dates, etc.)
When?
develop branch (almost) reflects the desired state of the new
release.
Hotfix branches
May branch off from: master
Must merge back into: develop and master
Branch naming convention: hotfix-*
When?
a critical bug in a production version must
be resolved immediately
Issue Branches
Must Branch off from: develop
Must merge back into: develop
Branch naming convention: issue#:issueId
IMP: mention #issueId in commit message.
This will link issue and the commit on github
When?
Issues are logged against you on github
issue tracker.
Git flow
Branch Per Task Approach:
1. Nobody must ever work on develop or master branch.
2. Always create a new branch for every task/issue/feature
3. Write code.
4. Test
5. Merge it back
6. Next task/feature/issue
Starting a task/feature/issue
1. switch to develop branch ( : git checkout develop)
2. pull latest develop from origin ( : git pull origin develop )
3. create new branch ( : git branch branch-name )
4. Switch to newly created branch( : git checkout branch-name)
5. Continue working….
After completing task/feature/issue
1. commit your code( : git commit -a -m “commit message” )
2. pull develop into current branch to make sure your code works with
latest develop branch(if updated by someone)(imp)
3. test functionality again
4. switch to develop branch ( : git checkout develop)
5. merge the task branch into develop ( : git merge branch-name)
6. delete branch branch-name ( : git branch -d branch-name )
7. Push develop back to origin ( : git push origin develop )
8. Next task / feature / issue
Things to remember:
1. Never perform more than one task in same branch
2. Use stashing if you don’t want to commit your code but still want to
checkout other branch or use later
3. Strictly follow naming conventions for branches and commit
messages
4. Delete branches once merged completely
Pull Requests:( Github )
1. Allows to review the code and then merge( not a git feature )
2. Open source project are managed with this approach
Thank You

More Related Content

PDF
Git-flow workflow and pull-requests
PPT
Git workflows presentation
PDF
Git flow Introduction
PPTX
Why Aren't You Using Git Flow?
PDF
Git and git flow
PDF
Git Series. Episode 3. Git Flow and Github-Flow
ODP
Git Flow - An Introduction
PDF
Git & gitflow
Git-flow workflow and pull-requests
Git workflows presentation
Git flow Introduction
Why Aren't You Using Git Flow?
Git and git flow
Git Series. Episode 3. Git Flow and Github-Flow
Git Flow - An Introduction
Git & gitflow

What's hot (20)

PDF
Git workflows
PPTX
Git workflows
PDF
Git Workflow With Gitflow
PDF
Git flow for daily use
PDF
Git flow
PPTX
My Git workflow
PDF
Pull Request (PR): A git workflow
PDF
Git introduction for Beginners
PPT
Git workflows
PDF
19 GitFlow #burningkeyboards
PPTX
Gitflow - Una metología para manejo de Branches
PDF
Git Tricks — git utilities that make life git easier
PPTX
An introduction to Git and GitFlow
PDF
Pubmi gitflow
PPTX
Git collaboration
PDF
The gitflow way
PDF
Web development, from git flow to github flow
PDF
Git with the flow
PPTX
Git Pull Requests
Git workflows
Git workflows
Git Workflow With Gitflow
Git flow for daily use
Git flow
My Git workflow
Pull Request (PR): A git workflow
Git introduction for Beginners
Git workflows
19 GitFlow #burningkeyboards
Gitflow - Una metología para manejo de Branches
Git Tricks — git utilities that make life git easier
An introduction to Git and GitFlow
Pubmi gitflow
Git collaboration
The gitflow way
Web development, from git flow to github flow
Git with the flow
Git Pull Requests
Ad

Similar to Git flow (20)

PDF
Introducing Git and git flow
PDF
Introduction to Git (part 3)
PPTX
A successful Git branching model
PDF
Developing with versioning and CI/CD
PPTX
GitFlow Workshop
PPTX
Git for work groups ironhack talk
PDF
A Git Workflow Model or Branching Strategy
PDF
Managing releases effectively through git
PPTX
Git development workflow
PDF
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
PDF
Git essentials
PPTX
Git - Simplified For Testers
PPTX
Gitflow - Branching and Merging Flow for Git
PPTX
Gitflow - Branching and Merging Flow for Git
PDF
How We Use GitHub
PDF
01 git interview questions & answers
PDF
Git basics a starter on git and its ecosystem
PPTX
Git usage (Basics and workflow)
PPTX
3DC Intro to Git Workshop
PPTX
Bitbucket git-bamboo-jira
Introducing Git and git flow
Introduction to Git (part 3)
A successful Git branching model
Developing with versioning and CI/CD
GitFlow Workshop
Git for work groups ironhack talk
A Git Workflow Model or Branching Strategy
Managing releases effectively through git
Git development workflow
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Git essentials
Git - Simplified For Testers
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
How We Use GitHub
01 git interview questions & answers
Git basics a starter on git and its ecosystem
Git usage (Basics and workflow)
3DC Intro to Git Workshop
Bitbucket git-bamboo-jira
Ad

Git flow

  • 1. Git Flow A Git branching model
  • 2. Why git? 1. Git is Fast 2. Git is Small 3. Distributed 4. GitHub 5. Git is the new standard 6. Easy to Learn( 21 commands) 7. Cheap Local Branching
  • 5. The Main Branches The central repo holds two main branches with an infinite lifetime: 1. master(always reflects a production-ready state) 2. develop( testable code, without any incomplete features or code)
  • 6. Supporting Branches 1. Supporting branches are used for: a. parallel development between team members b. ease tracking of features c. prepare for production releases d. assist in quickly fixing live production problems 2. These branches always have a limited lifetime Type of branches: 1. Feature branches 2. Release branches 3. Hotfix branches 4. Issue Branches 5. Your choice
  • 7. Feature Branches Branch off from: develop Must merge back into: develop Branch naming convention: feature-* 1. used to develop new features for the upcoming or a distant future release 2. exists as long as the feature is in development 3. can be merged back into develop ( to add new features) 4. or discarded (in case of a disappointing experiment) 5. Feature branches can be local branches or pushed to origin if more developers are working on same feature
  • 8. Release Branches Branch off from: develop Must merge back into: develop and master Branch naming convention: release-* 1. preparation of a new production release 2. allow for minor bug fixes 3. meta-data for a release (version number, build dates, etc.) When? develop branch (almost) reflects the desired state of the new release.
  • 9. Hotfix branches May branch off from: master Must merge back into: develop and master Branch naming convention: hotfix-* When? a critical bug in a production version must be resolved immediately
  • 10. Issue Branches Must Branch off from: develop Must merge back into: develop Branch naming convention: issue#:issueId IMP: mention #issueId in commit message. This will link issue and the commit on github When? Issues are logged against you on github issue tracker.
  • 12. Branch Per Task Approach: 1. Nobody must ever work on develop or master branch. 2. Always create a new branch for every task/issue/feature 3. Write code. 4. Test 5. Merge it back 6. Next task/feature/issue
  • 13. Starting a task/feature/issue 1. switch to develop branch ( : git checkout develop) 2. pull latest develop from origin ( : git pull origin develop ) 3. create new branch ( : git branch branch-name ) 4. Switch to newly created branch( : git checkout branch-name) 5. Continue working….
  • 14. After completing task/feature/issue 1. commit your code( : git commit -a -m “commit message” ) 2. pull develop into current branch to make sure your code works with latest develop branch(if updated by someone)(imp) 3. test functionality again 4. switch to develop branch ( : git checkout develop) 5. merge the task branch into develop ( : git merge branch-name) 6. delete branch branch-name ( : git branch -d branch-name ) 7. Push develop back to origin ( : git push origin develop ) 8. Next task / feature / issue
  • 15. Things to remember: 1. Never perform more than one task in same branch 2. Use stashing if you don’t want to commit your code but still want to checkout other branch or use later 3. Strictly follow naming conventions for branches and commit messages 4. Delete branches once merged completely
  • 16. Pull Requests:( Github ) 1. Allows to review the code and then merge( not a git feature ) 2. Open source project are managed with this approach