SlideShare a Scribd company logo
feature
branch
master
= production, stable
develop
= future production,
QA-grade
dev/cool
branch
feature
branch
dev/awesome
develop + cool
commit and push
branch regularly
Pull request
review PR,
commit any changes to dev/cool,
merge PR into develop,
delete dev/cool
“cool” commits
more “awesome” commits
rebase
dev/awesome
onto develop
dev/awesome
now includes
dev/cool features
develop + cool +
awesome
Pull request
review PR,
commit any changes to dev/awesome,
merge PR into develop,
delete dev/awesome
master
Pull request
push to prod
test on dev env
push to staging
test on dev env
the rebase moves things forward
initial “awesome” commits
initial “awesome” commits
master
= production, stable
develop
= future production,
QA grade
dev/cool
= integration branch
for big feature
branch
integration
branch
for big feature
feature/neato
dev/cool + neato
Pull request
review PR,
commit any changes to neato,
merge PR into dev/cool
delete neato
feature/nifty
sub-feature
branches
feature/nifty now
includes
dev/neato
features
rebase feature/nifty
onto dev/cool
the rebase “moves” prior nifty commits past the neato commits
(technically, it moves the point where nifty branched off ahead,
and the commits move with it)
nifty commits, batch 1 nifty commits, batch 1
nifty commits, batch 2
dev/cool + neato +
nifty
Pull request
review PR,
commit any changes to nifty,
merge PR into dev/cool
delete nifty
Pull request
develop
master
Pull request
merge
merge
develop + feature X
develop + feature X
+ feature Y
feature X PR merge
rebase
feature Y PR merge
rebase
$ git checkout develop; git pull # make sure my develop is up to date
$ git checkout -b dev/cool # create my branch
$ vi WarpCore.java FluxCapacitor.java # make changes
$ git commit -m “upgraded intake manifold in flux capacitor” WarpCore.java FluxCapacitor.java # commit
$ git push origin dev/cool # save changes in shared repo
Then:
· go to github and file a PR for dev/cool
· have someone review and merge your PR into develop
· have someone delete dev/cool
· other devs using branches off develop now rebase their branches onto develop to get the cool feature
· at next commit, other devs who rebased will need to push -f because of the rebase
· repeat ad infinitum
Basic Example
Joe and Jill are working on a big feature. Joe does:
$ git checkout develop; git pull # make sure Joe’s develop is up to date
$ git checkout -b dev/cool # create an integration branch for a big feature
$ git push origin dev/cool # put integration branch in shared repo for Jill
$ git checkout -b feature/neato # create sub-feature branch for neato sub-feature
$ vi WarpCore.java FluxCapacitor.java # make changes
$ git commit -m “upgraded intake manifold in flux capacitor” WarpCore.java FluxCapacitor.java # commit
$ git push origin feature/neato # save changes in shared repo
On her own schedule, Jill does:
$ git checkout dev/cool; git pull # get Joe’s integration branch
$ git checkout -b feature/nifty # create sub-feature branch for nifty sub-feature
$ vi Manifold.java # make changes
$ git commit -m “recalibrated intake manifold” Manifold.java # commit
$ git push origin feature/nifty # save changes in shared repo
Joe files a PR and gets his neato feature tested and merged into dev/cool. Jill wants to stay up to date:
$ git rebase dev/cool # brings in Joe’s changes and keeps Jill’s commits together, after Joe’s
$ vi Tribble.java # more changes
$ git commit -m “upped sensitivity to Klingons” Tribble.java
$ git push -f origin feature/nifty # save Jill’s changes in shared repo; -f after rebase
When done, Jill files a PR and gets her nifty feature tested and merged into dev/cool.
Then when dev/cool is feature complete, a PR is filed to do integration testing and merge into develop.
Feature Branch Example
·Thou shalt merge down and rebase up
·Thou shalt branch for everything (features & bug fixes)
·Thou shalt keep thy branches very short-lived
·Thou shalt keep master production-grade, ready to deploy, always
·Thou shalt push often
·Thou shalt pull often
·Thou shalt rebase often
·Thou shalt not commit directly into develop (penalty: waterboarding)
·Thou shalt not commit directly into master (penalty: violent death)
·Thou shalt not merge branches without a PR
The Ten Commandments of Git

More Related Content

What's hot

Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
Gengo
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
David Paluy
 
Culture of working together with git
Culture of working together  with gitCulture of working together  with git
Culture of working together with git
ibrahimgunduz34
 
Git flow
Git flowGit flow
Git flow
Valerio Como
 
Git workflow
Git workflowGit workflow
Git workflow
Arif Huda
 
Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?
John Congdon
 

What's hot (6)

Using Chef and Vagrant at Gengo
Using Chef and Vagrant at GengoUsing Chef and Vagrant at Gengo
Using Chef and Vagrant at Gengo
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
Culture of working together with git
Culture of working together  with gitCulture of working together  with git
Culture of working together with git
 
Git flow
Git flowGit flow
Git flow
 
Git workflow
Git workflowGit workflow
Git workflow
 
Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?Why Aren't You Using Git Flow?
Why Aren't You Using Git Flow?
 

Similar to A painless git workflow

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
Git workshop
Git workshopGit workshop
Git workshop
Ray Toal
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
Nick Quaranto
 
Git
GitGit
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
viniciusban
 
Lightning branches at RedMart (Js conf Asia 2014 Talk)
Lightning branches at RedMart (Js conf Asia 2014  Talk)Lightning branches at RedMart (Js conf Asia 2014  Talk)
Lightning branches at RedMart (Js conf Asia 2014 Talk)
Ritesh Angural
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
Joseluis Laso
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Lemi Orhan Ergin
 
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
Maulik 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 Git
Maulik Shah
 
Git collaboration
Git collaborationGit collaboration
Git collaboration
Pham Quy (Jack)
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Lemi Orhan Ergin
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
mpvanwinkle
 
Checkitmobile - using Git for development
Checkitmobile - using Git for developmentCheckitmobile - using Git for development
Checkitmobile - using Git for development
Gerrit Wanderer
 
Git basics
Git basicsGit basics
Git basics
Amit Sawhney
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
Tagged Social
 
VCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT WorkshopVCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT Workshop
Anis Ahmad
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
Mythri P K
 
Everything in code_slides
Everything in code_slidesEverything in code_slides
Everything in code_slides
Mack Hardy
 
Session git
Session gitSession git
Session git
Roni Saha
 

Similar to A painless git workflow (20)

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Git workshop
Git workshopGit workshop
Git workshop
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git
GitGit
Git
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Lightning branches at RedMart (Js conf Asia 2014 Talk)
Lightning branches at RedMart (Js conf Asia 2014  Talk)Lightning branches at RedMart (Js conf Asia 2014  Talk)
Lightning branches at RedMart (Js conf Asia 2014 Talk)
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it Again
 
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
 
Git collaboration
Git collaborationGit collaboration
Git collaboration
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Checkitmobile - using Git for development
Checkitmobile - using Git for developmentCheckitmobile - using Git for development
Checkitmobile - using Git for development
 
Git basics
Git basicsGit basics
Git basics
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
VCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT WorkshopVCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT Workshop
 
2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final2015-ghci-presentation-git_gerritJenkins_final
2015-ghci-presentation-git_gerritJenkins_final
 
Everything in code_slides
Everything in code_slidesEverything in code_slides
Everything in code_slides
 
Session git
Session gitSession git
Session git
 

Recently uploaded

Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 

Recently uploaded (20)

Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 

A painless git workflow

  • 1. feature branch master = production, stable develop = future production, QA-grade dev/cool branch feature branch dev/awesome develop + cool commit and push branch regularly Pull request review PR, commit any changes to dev/cool, merge PR into develop, delete dev/cool “cool” commits more “awesome” commits rebase dev/awesome onto develop dev/awesome now includes dev/cool features develop + cool + awesome Pull request review PR, commit any changes to dev/awesome, merge PR into develop, delete dev/awesome master Pull request push to prod test on dev env push to staging test on dev env the rebase moves things forward initial “awesome” commits initial “awesome” commits
  • 2. master = production, stable develop = future production, QA grade dev/cool = integration branch for big feature branch integration branch for big feature feature/neato dev/cool + neato Pull request review PR, commit any changes to neato, merge PR into dev/cool delete neato feature/nifty sub-feature branches feature/nifty now includes dev/neato features rebase feature/nifty onto dev/cool the rebase “moves” prior nifty commits past the neato commits (technically, it moves the point where nifty branched off ahead, and the commits move with it) nifty commits, batch 1 nifty commits, batch 1 nifty commits, batch 2 dev/cool + neato + nifty Pull request review PR, commit any changes to nifty, merge PR into dev/cool delete nifty Pull request develop master Pull request merge merge develop + feature X develop + feature X + feature Y feature X PR merge rebase feature Y PR merge rebase
  • 3. $ git checkout develop; git pull # make sure my develop is up to date $ git checkout -b dev/cool # create my branch $ vi WarpCore.java FluxCapacitor.java # make changes $ git commit -m “upgraded intake manifold in flux capacitor” WarpCore.java FluxCapacitor.java # commit $ git push origin dev/cool # save changes in shared repo Then: · go to github and file a PR for dev/cool · have someone review and merge your PR into develop · have someone delete dev/cool · other devs using branches off develop now rebase their branches onto develop to get the cool feature · at next commit, other devs who rebased will need to push -f because of the rebase · repeat ad infinitum Basic Example
  • 4. Joe and Jill are working on a big feature. Joe does: $ git checkout develop; git pull # make sure Joe’s develop is up to date $ git checkout -b dev/cool # create an integration branch for a big feature $ git push origin dev/cool # put integration branch in shared repo for Jill $ git checkout -b feature/neato # create sub-feature branch for neato sub-feature $ vi WarpCore.java FluxCapacitor.java # make changes $ git commit -m “upgraded intake manifold in flux capacitor” WarpCore.java FluxCapacitor.java # commit $ git push origin feature/neato # save changes in shared repo On her own schedule, Jill does: $ git checkout dev/cool; git pull # get Joe’s integration branch $ git checkout -b feature/nifty # create sub-feature branch for nifty sub-feature $ vi Manifold.java # make changes $ git commit -m “recalibrated intake manifold” Manifold.java # commit $ git push origin feature/nifty # save changes in shared repo Joe files a PR and gets his neato feature tested and merged into dev/cool. Jill wants to stay up to date: $ git rebase dev/cool # brings in Joe’s changes and keeps Jill’s commits together, after Joe’s $ vi Tribble.java # more changes $ git commit -m “upped sensitivity to Klingons” Tribble.java $ git push -f origin feature/nifty # save Jill’s changes in shared repo; -f after rebase When done, Jill files a PR and gets her nifty feature tested and merged into dev/cool. Then when dev/cool is feature complete, a PR is filed to do integration testing and merge into develop. Feature Branch Example
  • 5. ·Thou shalt merge down and rebase up ·Thou shalt branch for everything (features & bug fixes) ·Thou shalt keep thy branches very short-lived ·Thou shalt keep master production-grade, ready to deploy, always ·Thou shalt push often ·Thou shalt pull often ·Thou shalt rebase often ·Thou shalt not commit directly into develop (penalty: waterboarding) ·Thou shalt not commit directly into master (penalty: violent death) ·Thou shalt not merge branches without a PR The Ten Commandments of Git