SlideShare uma empresa Scribd logo
1 de 13
A successful Git branching
model
For a smooth and non conflicting development experience
The Problem
- Multiple member working on different parts unnecessarily delaying each
other.
- Cant release urgent changes because there are uncomplete features in the
code .
- Inability to isolate features for testing.
- Inability to revert a specific feature without reverting other features or code
changes.
- A lot of time wasted on merge conflicts.
The Goal
- Focus on a specific target while developing.
- Be able to apply urgent changes
- Isolate features for testing.
- Flexibility and ability to revert features or code parts without affecting other
parts.
- Ability to work on features for distant releases.
- Reduce merge conflict time.
The model
Main Branches
- Master Branch
- Develop Branch
Support Branches
- Feature branches
- Release branches
- Hotfix branches
Main Branches
- These Branches will always be there and live as
long as the project lives
- Master should always reflect a production-ready
state.
- Develop reflects a state with the latest delivered
development changes for the next release
Support Branches - Feature
Feature branch is used to develop a new feature for the next or a distant
release.
May branch off from : develop
Must merge back into : develop
Branch naming convention:
anything except :
master,develop, release-*, or hotfix-*
Support Branches - Feature
Create a feature branch from the develop branch
Implement the feature .
When done , merge back into develop branch
$ git checkout -b myfeature develop
// do the coding
$ git checkout develop
$ git merge --no-ff myfeature
$ git branch -d myfeature
$ git push origin develop
Support Branches - Release
- Should be created once ready or almost done for a new release.
- no new features should be added here
- Clears space for other team members to work on new features from the
development branch.
- Changes on this branch should be done to solve bugs found before release
- Metadata , version number ,build data , etc...
May branch off from : develop
Must merge back into : develop and master
Branch naming convention : release-*
Support Branches - Release
- Create a release branch from the develop
branch.
- Update release metadata.
- Solve any found bugs.
- When done , merge into develop branch and
release branch
- Give a tag on the master branch
- Delete the branch
$ git checkout -b release-1.2 develop
// do the coding
$ git commit -a -m "updated version
number”
$ git checkout master
$ git merge --no-ff release-1.2
$ git tag -a 1.2
$ git checkout develop
$ git merge --no-ff release-1.2
$ git branch -d release-1.2
Support Branches - Hotfix
- Hotfix branches are created when it’s
needed to apply urgent changes or
hotfixes for bugs detected on the
production that can’t wait for the next
release.
- Its behaviour is very similar to a release
branch because it eventually creates a
new release.
May branch off from : master
Must merge back into : develop and master
Branch naming convention : hotfix-*
Support Branches - Hotfix
- Create a hotfix branch from the develop branch.
- Update version.
- Solve any found bugs.
- When done , merge into develop branch and
release branch
- Give a tag on the master branch
- Delete the branch
$ git checkout -b hotfix-1.2.1 master
// apply hotfix and update version number and
metadata etc..
$ git commit -m "Fixed severe production
problem"
$ git checkout master
$ git merge --no-ff hotfix-1.2.1
$ git tag -a 1.2.1
$ git checkout develop
$ git merge --no-ff hotfix-1.2.1
$ git branch -d hotfix-1.2.1
The Big Picture
Thank you

Mais conteúdo relacionado

Mais procurados

Git Branching for Agile Teams
Git Branching for Agile Teams Git Branching for Agile Teams
Git Branching for Agile Teams Atlassian
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentationMack Hardy
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requestsBartosz Kosarzycki
 
Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flowKnoldus Inc.
 
Git workflows
Git workflowsGit workflows
Git workflowsXpand IT
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for BeginnersNebulaworks
 
Git branch management
Git branch managementGit branch management
Git branch managementMatt Liu
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based developmentgo_oh
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Branching and merging strategy
Branching and merging strategyBranching and merging strategy
Branching and merging strategyRahul Janghel
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab IntroductionKrunal Doshi
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Noa Harel
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
 

Mais procurados (20)

Git Branching for Agile Teams
Git Branching for Agile Teams Git Branching for Agile Teams
Git Branching for Agile Teams
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Git flow
Git flowGit flow
Git flow
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flow
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
 
Git branch management
Git branch managementGit branch management
Git branch management
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Git
GitGit
Git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git basics
Git basicsGit basics
Git basics
 
Branching and merging strategy
Branching and merging strategyBranching and merging strategy
Branching and merging strategy
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Introduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training SessionIntroduction to Gitlab | Gitlab 101 | Training Session
Introduction to Gitlab | Gitlab 101 | Training Session
 

Destaque

Git branching-model
Git branching-modelGit branching-model
Git branching-modelAaron Huang
 
Git in Continuous Deployment
Git in Continuous DeploymentGit in Continuous Deployment
Git in Continuous DeploymentBrett Child
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git RightSven Peters
 
Git Branching for Agile Teams
Git Branching for Agile TeamsGit Branching for Agile Teams
Git Branching for Agile TeamsSven Peters
 
Continuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonestContinuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonestShawn Jones
 
Reconstructing the past with media wiki
Reconstructing the past with media wikiReconstructing the past with media wiki
Reconstructing the past with media wikiShawn Jones
 
Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With GitflowJosh Dvir
 
Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...
Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...
Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...DataWorks Summit/Hadoop Summit
 
A successful git branching model 導讀
A successful git branching model 導讀A successful git branching model 導讀
A successful git branching model 導讀Wen Liao
 
Apache Hadoop and HBase
Apache Hadoop and HBaseApache Hadoop and HBase
Apache Hadoop and HBaseCloudera, Inc.
 
Multi-tenant, Multi-cluster and Multi-container Apache HBase Deployments
Multi-tenant, Multi-cluster and Multi-container Apache HBase DeploymentsMulti-tenant, Multi-cluster and Multi-container Apache HBase Deployments
Multi-tenant, Multi-cluster and Multi-container Apache HBase DeploymentsDataWorks Summit
 
HBase: Just the Basics
HBase: Just the BasicsHBase: Just the Basics
HBase: Just the BasicsHBaseCon
 
Jenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentJenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentDan Stine
 
HBaseCon 2012 | HBase Filtering - Lars George, Cloudera
HBaseCon 2012 | HBase Filtering - Lars George, ClouderaHBaseCon 2012 | HBase Filtering - Lars George, Cloudera
HBaseCon 2012 | HBase Filtering - Lars George, ClouderaCloudera, Inc.
 

Destaque (17)

Git branching-model
Git branching-modelGit branching-model
Git branching-model
 
Git in Continuous Deployment
Git in Continuous DeploymentGit in Continuous Deployment
Git in Continuous Deployment
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 
Git Branching for Agile Teams
Git Branching for Agile TeamsGit Branching for Agile Teams
Git Branching for Agile Teams
 
Continuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonestContinuous Integration: Finding problems soonest
Continuous Integration: Finding problems soonest
 
Reconstructing the past with media wiki
Reconstructing the past with media wikiReconstructing the past with media wiki
Reconstructing the past with media wiki
 
Git Workflow With Gitflow
Git Workflow With GitflowGit Workflow With Gitflow
Git Workflow With Gitflow
 
Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...
Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...
Apache HBase + Spark: Leveraging your Non-Relational Datastore in Batch and S...
 
A successful git branching model 導讀
A successful git branching model 導讀A successful git branching model 導讀
A successful git branching model 導讀
 
Apache Hadoop and HBase
Apache Hadoop and HBaseApache Hadoop and HBase
Apache Hadoop and HBase
 
Multi-tenant, Multi-cluster and Multi-container Apache HBase Deployments
Multi-tenant, Multi-cluster and Multi-container Apache HBase DeploymentsMulti-tenant, Multi-cluster and Multi-container Apache HBase Deployments
Multi-tenant, Multi-cluster and Multi-container Apache HBase Deployments
 
HBase: Just the Basics
HBase: Just the BasicsHBase: Just the Basics
HBase: Just the Basics
 
Jenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentJenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated Deployment
 
Getting Git
Getting GitGetting Git
Getting Git
 
Git workflows
Git workflowsGit workflows
Git workflows
 
git flow
git flowgit flow
git flow
 
HBaseCon 2012 | HBase Filtering - Lars George, Cloudera
HBaseCon 2012 | HBase Filtering - Lars George, ClouderaHBaseCon 2012 | HBase Filtering - Lars George, Cloudera
HBaseCon 2012 | HBase Filtering - Lars George, Cloudera
 

Semelhante a A successful Git branching model

Git development workflow
Git development workflowGit development workflow
Git development workflowSankar Suda
 
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
 
Checkitmobile - using Git for development
Checkitmobile - using Git for developmentCheckitmobile - using Git for development
Checkitmobile - using Git for developmentGerrit Wanderer
 
Source code management with Git
Source code management with GitSource code management with Git
Source code management with GitRadu Barbu
 
How to use Git Branch
How to use Git BranchHow to use Git Branch
How to use Git BranchPhuoc Nguyen
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced gitGerrit Wanderer
 
Clarive 7 Branching Model
Clarive 7 Branching ModelClarive 7 Branching Model
Clarive 7 Branching ModelClarive
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow WorkshopSyed Imam
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through gitMohd Farid
 
Git and Git Workflow Models as Catalysts of Software Development
Git and Git Workflow Models as Catalysts of Software DevelopmentGit and Git Workflow Models as Catalysts of Software Development
Git and Git Workflow Models as Catalysts of Software DevelopmentLemi Orhan Ergin
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 

Semelhante a A successful Git branching model (20)

Git development workflow
Git development workflowGit development workflow
Git development workflow
 
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
 
Checkitmobile - using Git for development
Checkitmobile - using Git for developmentCheckitmobile - using Git for development
Checkitmobile - using Git for development
 
Source code management with Git
Source code management with GitSource code management with Git
Source code management with Git
 
Git collaboration
Git collaborationGit collaboration
Git collaboration
 
How to use Git Branch
How to use Git BranchHow to use Git Branch
How to use Git Branch
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git flow
Git flowGit flow
Git flow
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced git
 
Clarive 7 Branching Model
Clarive 7 Branching ModelClarive 7 Branching Model
Clarive 7 Branching Model
 
GitFlow Workshop
GitFlow WorkshopGitFlow Workshop
GitFlow Workshop
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through git
 
Gitflow Workflow
Gitflow WorkflowGitflow Workflow
Gitflow Workflow
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Git and Git Workflow Models as Catalysts of Software Development
Git and Git Workflow Models as Catalysts of Software DevelopmentGit and Git Workflow Models as Catalysts of Software Development
Git and Git Workflow Models as Catalysts of Software Development
 
Git more done
Git more doneGit more done
Git more done
 
Gitflow
GitflowGitflow
Gitflow
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
git Technologies
git Technologiesgit Technologies
git Technologies
 

A successful Git branching model

  • 1. A successful Git branching model For a smooth and non conflicting development experience
  • 2. The Problem - Multiple member working on different parts unnecessarily delaying each other. - Cant release urgent changes because there are uncomplete features in the code . - Inability to isolate features for testing. - Inability to revert a specific feature without reverting other features or code changes. - A lot of time wasted on merge conflicts.
  • 3. The Goal - Focus on a specific target while developing. - Be able to apply urgent changes - Isolate features for testing. - Flexibility and ability to revert features or code parts without affecting other parts. - Ability to work on features for distant releases. - Reduce merge conflict time.
  • 4. The model Main Branches - Master Branch - Develop Branch Support Branches - Feature branches - Release branches - Hotfix branches
  • 5. Main Branches - These Branches will always be there and live as long as the project lives - Master should always reflect a production-ready state. - Develop reflects a state with the latest delivered development changes for the next release
  • 6. Support Branches - Feature Feature branch is used to develop a new feature for the next or a distant release. May branch off from : develop Must merge back into : develop Branch naming convention: anything except : master,develop, release-*, or hotfix-*
  • 7. Support Branches - Feature Create a feature branch from the develop branch Implement the feature . When done , merge back into develop branch $ git checkout -b myfeature develop // do the coding $ git checkout develop $ git merge --no-ff myfeature $ git branch -d myfeature $ git push origin develop
  • 8. Support Branches - Release - Should be created once ready or almost done for a new release. - no new features should be added here - Clears space for other team members to work on new features from the development branch. - Changes on this branch should be done to solve bugs found before release - Metadata , version number ,build data , etc... May branch off from : develop Must merge back into : develop and master Branch naming convention : release-*
  • 9. Support Branches - Release - Create a release branch from the develop branch. - Update release metadata. - Solve any found bugs. - When done , merge into develop branch and release branch - Give a tag on the master branch - Delete the branch $ git checkout -b release-1.2 develop // do the coding $ git commit -a -m "updated version number” $ git checkout master $ git merge --no-ff release-1.2 $ git tag -a 1.2 $ git checkout develop $ git merge --no-ff release-1.2 $ git branch -d release-1.2
  • 10. Support Branches - Hotfix - Hotfix branches are created when it’s needed to apply urgent changes or hotfixes for bugs detected on the production that can’t wait for the next release. - Its behaviour is very similar to a release branch because it eventually creates a new release. May branch off from : master Must merge back into : develop and master Branch naming convention : hotfix-*
  • 11. Support Branches - Hotfix - Create a hotfix branch from the develop branch. - Update version. - Solve any found bugs. - When done , merge into develop branch and release branch - Give a tag on the master branch - Delete the branch $ git checkout -b hotfix-1.2.1 master // apply hotfix and update version number and metadata etc.. $ git commit -m "Fixed severe production problem" $ git checkout master $ git merge --no-ff hotfix-1.2.1 $ git tag -a 1.2.1 $ git checkout develop $ git merge --no-ff hotfix-1.2.1 $ git branch -d hotfix-1.2.1