SlideShare a Scribd company logo
1 of 29
By Walter Liu
WRS GIT branching model (draft)
Agenda
》 GIT Branches
》 How to work
》 Others
× Purpose behind
× Misc – Tips
× Misc – Troubleshooting
× RPM repo
× Versioning
GIT BRACHES
Overview
Private Personal Branch
》 Name: <account_name>
》 Set git remote branch to this
》 For developer daily work.
》 Promote to dev branch
》 Pull updates from dev branch
Dev branch (1/2)
Develop branch (2/2)
》 Name: dev
》 Require functional and unit test ready.
》 It’s best to have CI.
》 For dev build.
》 Promote to master branch
》 Update from
× Private branch
× Feature branch
× Hotfix branch
OUR master branch
》 Name: 1.0, 2.0 …..
》 Promote source from dev branch.
》 Release staging-candidate build.
× At the same time, tag it with
release version.
》 Update from
× dev branch
× hotfix branch
Feature Branch
》 Name: feature_<Feature_name>
× Example: feature_odin_authentication
》 Scenario:
× Feature that impact integration test
› Example: odin_authentication.
× Big feature
× Big project with many people
》 Promote to dev branch
》 Pull update from dev branch
Hotfix branch
》 Prefix:
× hotfix-<TT_number>-
<TT_number>.....
》 Scenario
× If your dev branch is working on
something.
》 Pull from master branch
》 Promote to
× master branch(s)
× dev branch
*Remember to prompt code to master and dev at the same time.
HOW TO WORK
So, how should we work.
》 For developers,
× Project start
› Create remote private branch.
› Set git remote branch to your private branch.
× Work on it, daily push source to private branch.
× Once finish a feature and it’s unit/functional test. Push to dev branch.
》 For RD lead,
× At project start, notify team members the git guidelines.
× START A NEW GIT PROJECT, see next slide
× [Recommended] Setup CI on dev and master branch.
× Use dev for developer development and test.
× For release a new build to OPS or staging test.
› Ensure the code quality is good enough.
› Promote code from dev to master branch.
› Git tag and master with release version.
Start a new git project
》 Create 1.0 or 2.0 .... For release
× Set it protected
》 Create dev branch
》 Set default branch to dev
》 Remove master branch
New Project
Set default branch
New Project
Set projected branch
Create a new remote branch
and track it locally
》 “Create branch on gitlab” or
》 git fetch origin
》 git branch --track <branch> origin/<branch>
》 git checkout <branch>
OR
# -b create new branch from dev branch
》 git checkout –b <new_branch> dev
# -u ,push source to remote and setup tracking
》 git push –u origin <new_branch>
Update source from dev
branch to private branch
》 git checkout <private_branch>
》 git pull
》 git merge dev
》 git push
OR
》 git pull origin dev <private_branch>
Promote source from private
branch to dev branch
》 git checkout dev
》 git pull
》 git merge <private_branch>
》 git push
OR
》 git push origin <private_branch>:dev
Promote source from dev
branch to master branch
》 Similar to last page
OR
# make sure local dev branch updated
#  git pull origin dev
》 git push origin dev:master
Promote source from hotfix
branch to dev/master branch
# make sure local dev branch updated
# git pull origin hotfix-<..>
》 git push origin hotfix-<..>:master
》 git push origin hotfix-<..>:dev
Git tag
》 When,
× Release a build from master branch
》 Format: v<version>
》 Command
× git tag –a <tag_name>
× Use gitlab to tag. (easier)
》 Integrated in CI is recommended.
OTHERS
Purposes behind
》 Private personal branch
× Daily push to remote (HD broken)
× Lazy to switch branch (:P)
》 Tagging
× Tag release version on master branch for
easier trace back and troubleshooting.
》 Why 1.0, 2.0 branch?
× For module development
Misc - Tips
》 Rebase  Merge
》 No-fast-forward for feature branch
commit to dev branch.
》 For bug fixes
× Use interactive rebase to squash commits
into one.
× Easier to
› code view
› Traceback/troubleshooting
Misc – Troubleshooting
Check local/Remote branch
》 git branch –a
Remote repository status
》 git remote show origin
RPM repo
》 dev branch build to dev-repo
》 1.0/2.0… branch build to int-repo
》 QA promote a rpm from int-repo to stg-repo
》 OPS promote a rpm from stg-repo to prod-
repo
Versioning
》 dev branch and master branch should
use different version.
》 Since they put into different rpm repos,
it’s not required to use different formats.
References
》 http://nvie.com/posts/a-successful-git-
branching-model/
》 http://www.slideshare.net/lemiorhan/git-
branching-model
Q & A

More Related Content

Similar to WRS GIT Branching Model - draft

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
Nowell Strite
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced git
Gerrit Wanderer
 

Similar to WRS GIT Branching Model - draft (20)

Microservices Development Process at Predix.io
Microservices Development Process at Predix.ioMicroservices Development Process at Predix.io
Microservices Development Process at Predix.io
 
Git
GitGit
Git
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
An intro to git
An intro to gitAn intro to git
An intro to git
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Getting started with git svn
Getting started with git svnGetting started with git svn
Getting started with git svn
 
Developing with versioning and CI/CD
Developing with versioning and CI/CDDeveloping with versioning and CI/CD
Developing with versioning and CI/CD
 
Acquia BLT for the Win, or How to speed up the project setup, development an...
Acquia BLT for the Win, or  How to speed up the project setup, development an...Acquia BLT for the Win, or  How to speed up the project setup, development an...
Acquia BLT for the Win, or How to speed up the project setup, development an...
 
Git for work groups ironhack talk
Git for work groups ironhack talkGit for work groups ironhack talk
Git for work groups ironhack talk
 
Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
 
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
 
Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced git
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Automated Drupal deployment with Git and Capistrano
Automated Drupal deployment with Git and CapistranoAutomated Drupal deployment with Git and Capistrano
Automated Drupal deployment with Git and Capistrano
 
Constantly Contributing Pretty Patches FLCD
Constantly Contributing Pretty Patches FLCDConstantly Contributing Pretty Patches FLCD
Constantly Contributing Pretty Patches FLCD
 
git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)
 
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket PipelinesSalesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
 
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
Open Sprintera (Where Open Source Sparks a Sprint of Possibilities)
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
 

More from Walter Liu

Salty OPS – Saltstack Introduction
Salty OPS – Saltstack IntroductionSalty OPS – Saltstack Introduction
Salty OPS – Saltstack Introduction
Walter Liu
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yum
Walter Liu
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpoint
Walter Liu
 

More from Walter Liu (18)

Generative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfGenerative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdf
 
Infrastructure as code using Kubernetes
Infrastructure as code using KubernetesInfrastructure as code using Kubernetes
Infrastructure as code using Kubernetes
 
手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談
 
關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes Workshop
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCP
 
Game DDOS Prevention
Game DDOS PreventionGame DDOS Prevention
Game DDOS Prevention
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent Introduction
 
HTTP/2 to web dev
HTTP/2 to web devHTTP/2 to web dev
HTTP/2 to web dev
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
Consul - service discovery and others
Consul - service discovery and othersConsul - service discovery and others
Consul - service discovery and others
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Salty OPS – Saltstack Introduction
Salty OPS – Saltstack IntroductionSalty OPS – Saltstack Introduction
Salty OPS – Saltstack Introduction
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yum
 
Game Localization in Python
Game Localization in PythonGame Localization in Python
Game Localization in Python
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpoint
 
Celery in the Django
Celery in the DjangoCelery in the Django
Celery in the Django
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

WRS GIT Branching Model - draft

  • 1. By Walter Liu WRS GIT branching model (draft)
  • 2. Agenda 》 GIT Branches 》 How to work 》 Others × Purpose behind × Misc – Tips × Misc – Troubleshooting × RPM repo × Versioning
  • 5. Private Personal Branch 》 Name: <account_name> 》 Set git remote branch to this 》 For developer daily work. 》 Promote to dev branch 》 Pull updates from dev branch
  • 7. Develop branch (2/2) 》 Name: dev 》 Require functional and unit test ready. 》 It’s best to have CI. 》 For dev build. 》 Promote to master branch 》 Update from × Private branch × Feature branch × Hotfix branch
  • 8. OUR master branch 》 Name: 1.0, 2.0 ….. 》 Promote source from dev branch. 》 Release staging-candidate build. × At the same time, tag it with release version. 》 Update from × dev branch × hotfix branch
  • 9. Feature Branch 》 Name: feature_<Feature_name> × Example: feature_odin_authentication 》 Scenario: × Feature that impact integration test › Example: odin_authentication. × Big feature × Big project with many people 》 Promote to dev branch 》 Pull update from dev branch
  • 10. Hotfix branch 》 Prefix: × hotfix-<TT_number>- <TT_number>..... 》 Scenario × If your dev branch is working on something. 》 Pull from master branch 》 Promote to × master branch(s) × dev branch *Remember to prompt code to master and dev at the same time.
  • 12. So, how should we work. 》 For developers, × Project start › Create remote private branch. › Set git remote branch to your private branch. × Work on it, daily push source to private branch. × Once finish a feature and it’s unit/functional test. Push to dev branch. 》 For RD lead, × At project start, notify team members the git guidelines. × START A NEW GIT PROJECT, see next slide × [Recommended] Setup CI on dev and master branch. × Use dev for developer development and test. × For release a new build to OPS or staging test. › Ensure the code quality is good enough. › Promote code from dev to master branch. › Git tag and master with release version.
  • 13. Start a new git project 》 Create 1.0 or 2.0 .... For release × Set it protected 》 Create dev branch 》 Set default branch to dev 》 Remove master branch
  • 16. Create a new remote branch and track it locally 》 “Create branch on gitlab” or 》 git fetch origin 》 git branch --track <branch> origin/<branch> 》 git checkout <branch> OR # -b create new branch from dev branch 》 git checkout –b <new_branch> dev # -u ,push source to remote and setup tracking 》 git push –u origin <new_branch>
  • 17. Update source from dev branch to private branch 》 git checkout <private_branch> 》 git pull 》 git merge dev 》 git push OR 》 git pull origin dev <private_branch>
  • 18. Promote source from private branch to dev branch 》 git checkout dev 》 git pull 》 git merge <private_branch> 》 git push OR 》 git push origin <private_branch>:dev
  • 19. Promote source from dev branch to master branch 》 Similar to last page OR # make sure local dev branch updated #  git pull origin dev 》 git push origin dev:master
  • 20. Promote source from hotfix branch to dev/master branch # make sure local dev branch updated # git pull origin hotfix-<..> 》 git push origin hotfix-<..>:master 》 git push origin hotfix-<..>:dev
  • 21. Git tag 》 When, × Release a build from master branch 》 Format: v<version> 》 Command × git tag –a <tag_name> × Use gitlab to tag. (easier) 》 Integrated in CI is recommended.
  • 23. Purposes behind 》 Private personal branch × Daily push to remote (HD broken) × Lazy to switch branch (:P) 》 Tagging × Tag release version on master branch for easier trace back and troubleshooting. 》 Why 1.0, 2.0 branch? × For module development
  • 24. Misc - Tips 》 Rebase  Merge 》 No-fast-forward for feature branch commit to dev branch. 》 For bug fixes × Use interactive rebase to squash commits into one. × Easier to › code view › Traceback/troubleshooting
  • 25. Misc – Troubleshooting Check local/Remote branch 》 git branch –a Remote repository status 》 git remote show origin
  • 26. RPM repo 》 dev branch build to dev-repo 》 1.0/2.0… branch build to int-repo 》 QA promote a rpm from int-repo to stg-repo 》 OPS promote a rpm from stg-repo to prod- repo
  • 27. Versioning 》 dev branch and master branch should use different version. 》 Since they put into different rpm repos, it’s not required to use different formats.
  • 29. Q & A

Editor's Notes

  1. dev -> dev build Master -> int build E2E test (int build)  [move int build to] staging build Or dev -> dev build Master -> staging build (E2E test, this more like staging-candidate. Need tagging)
  2. In a big project, dev branch needs to be more conservative: feature that need many people work with.
  3. git update-ref: Change default branch after clone a repo.
  4. Lazy to switch branch Most of time, we’re working on one thing only. Versioning Add git commit [X] Sep
  5. For troubleshooting
  6. Different version means they should not be continuous versions.