SlideShare uma empresa Scribd logo
1 de 17
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.
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

Mais conteúdo relacionado

Mais procurados

Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With GitflowJosh Dvir
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Pull Request (PR): A git workflow
Pull Request (PR): A git workflow Pull Request (PR): A git workflow
Pull Request (PR): A git workflow Joan Yin
 
Git introduction for Beginners
Git introduction for BeginnersGit introduction for Beginners
Git introduction for BeginnersMortezaTaghaddomi
 
Git workflows
Git workflowsGit workflows
Git workflowsXpand IT
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboardsDenis Ristic
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesJavier Alvarez
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierChristoph Matthies
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlowMark Everard
 
The gitflow way
The gitflow wayThe gitflow way
The gitflow wayRuijun Li
 
Web development, from git flow to github flow
Web development, from git flow to github flowWeb development, from git flow to github flow
Web development, from git flow to github flowCaesar Chi
 
Git with the flow
Git with the flowGit with the flow
Git with the flowDana White
 

Mais procurados (20)

Git workflows
Git workflowsGit workflows
Git workflows
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With Gitflow
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Git flow
Git flowGit flow
Git flow
 
My Git workflow
My Git workflowMy Git workflow
My Git workflow
 
Pull Request (PR): A git workflow
Pull Request (PR): A git workflow Pull Request (PR): A git workflow
Pull Request (PR): A git workflow
 
Git introduction for Beginners
Git introduction for BeginnersGit introduction for Beginners
Git introduction for Beginners
 
Git workflows
Git workflowsGit workflows
Git workflows
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
 
Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de BranchesGitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlow
 
Pubmi gitflow
Pubmi gitflowPubmi gitflow
Pubmi gitflow
 
Git collaboration
Git collaborationGit collaboration
Git collaboration
 
The gitflow way
The gitflow wayThe gitflow way
The gitflow way
 
Web development, from git flow to github flow
Web development, from git flow to github flowWeb development, from git flow to github flow
Web development, from git flow to github flow
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
Git Pull Requests
Git Pull RequestsGit Pull Requests
Git Pull Requests
 
git flow
git flowgit flow
git flow
 

Semelhante a Git flow

Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model abodeltae
 
Developing with versioning and CI/CD
Developing with versioning and CI/CDDeveloping with versioning and CI/CD
Developing with versioning and CI/CDMatteo Di Carlo
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow WorkshopSyed Imam
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talkTiago Ameller
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyVivek Parihar
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through gitMohd Farid
 
Git development workflow
Git development workflowGit development workflow
Git development workflowSankar Suda
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincitOy
 
Git - Simplified For Testers
Git - Simplified For TestersGit - Simplified For Testers
Git - Simplified For Testersupadhyay_25
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitMaulik Shah
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitMaulik Shah
 
How We Use GitHub
How We Use GitHubHow We Use GitHub
How We Use GitHubNYC DevShop
 
01 git interview questions & answers
01   git interview questions & answers01   git interview questions & answers
01 git interview questions & answersDeepQuest Software
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystemFrançois D'Agostini
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)Yeasin Abedin
 
3DC Intro to Git Workshop
3DC Intro to Git Workshop3DC Intro to Git Workshop
3DC Intro to Git WorkshopBeckhamWee
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jiralenamattt
 

Semelhante a Git flow (20)

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

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.
  • 11.
  • 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