SlideShare une entreprise Scribd logo
1  sur  56
Git
Branching –
the battle of
the ages
What’s better?
Extensive branching or
trunk-based development?
Jasmin Fluri
Gianni Ceresa
Disclaimer
This presentation is intended for
educational purposes only and
does not replace independent
professional judgment.
Statements of fact and opinions
expressed are those of the
presenters and are subject for bias.
Why do we need a
branching strategy?
Why you
absolutely
need a
defined git
strategy!
… not
having a git
strategy
means…
some people push their changes
directly to main…
… others create branches,
some create merge requests and
expect a review…
tags are sometimes created,
sometimes not…
… it’s a mess.
Without a defined git strategy…
… we need to define what happens …
a branching strategy covers the FULL lifecycle
… from when we
start implementing
a feature…
… until it is installed
in production!
2 different git strategies
Jasmin Fluri
Schaltstelle GmbH
@jasminfluri
Trunk-based development
Branch-based development
I first started with CVS back in ... can’t remember...
Gianni Ceresa
DATAlysis LLC
I’m supposed to play the old man here...
@G_Ceresa
I’m supposed to play the young gun here...
Born in the Git century – never used SVN or CVS
The Science of
Database
CI/CD
12:00 – 12:45
Ashstead 1 & 2
4 Steps in a Project Lifecycle
Start project
1
Review code
2
Build an
integration
pipeline
3
Ship feature
4
4 Steps in a Project Lifecycle
Start project
1
Review code
2
Build an
integration
pipeline
3
Ship feature
4
Starting a project …
Trunk based development is easy!
Trunk based does not mean you have no
branches!
Trunk-based
development combines
both
speed (bringing changes
into production fast)
and safety (automated
testing in the pipeline).
Trunk based development and infrastructure
code!
Source: https://github.com/michaellihs/presentations/blob/main/2021-10-21-infra-pipelines-baselone/presentation.pdf
Branch based development is ….
Also easy!
Until Jasmin finds a
fun picture of it...
Branch based development is ….
GitFlow
Everything can be a branch
Everything “needs” a branch
Once you start using branches,
no reason to stop!
And then you merge, merge and
merge branches...
COMMIT
GitFlow …
Jasmin
Gianni
Branch based development is... suggested by
Oracle
Branch based development: many ways
GitFlow has been the first, presented in 2010
• In development age this is a loooooong time ago!
Many more followed:
• GitHubFlow
• GitLabFlow
• OneFlow
• *whatever*-flow
Good luck with Trunk based!
Image by Anita S. from Pixabay Photo by Alexandre Debiève on Unsplash
Or relax with Branch based!
Alone
Singapore Airlines
Or relax with Branch based!
Or in a
team
Qatar Airways
4 Steps in a Project Lifecycle
Start project
1
Review code
2
Build an
integration
pipeline
3
Ship feature
4
Code Reviews in
Trunk-based
Development
• Either happens directly during
pair programming ….
• … or code reviews are very
small due to very small merge
requests!
• But we want to avoid merging…
Handovers in software development
Merging is bad for you!
• Merging is hard work
• Merging is a change to the codebase
• requires testing before and after the
merge
• No guarantee that integration works both
before and after the merge
• No branches == no merging
• Small batches == short test cycles
But we need a
way to introduce
changes step by
step!
Branching by Abstraction is your Friend!
Code Reviews in
Branch-based
Development
• Either happens directly during pair
programming ….
• … or code reviews happen once
when the development is over
before merging!
• And we aren’t afraid of merging…
Code Reviews in
Branch-based
• There isn’t one unique universal way for this
• Heavily depends on what you are versioning and your
processes
• Regression testing is your friend
• If you have a full set of regression tests covering your
code base, no regression = no issues and you can safely
merge
• If you aren’t happy with the quality of the code, no issues: the
branch is independent, nothing will be impacted by keeping it
there and work on it again
• Somebody else can easily take over a feature and keep
working on the branch
Merging can be your friend!
• Again ... It all depends on what you are
versioning and your processes
• Not everybody is versioning
just “some code”
• The better your tests,
the more you can “blindly” merge
• Of course it requires testing before
and after, but is this a bad thing?
• If you have full coverage with your
tests, tests are successful, there is
little reason to believe something will
break in an unexpected way
Branching for
real is better
than
“virtually”
• Why branching by abstraction
instead of a real branch?
• No need of any “_v2” or other
weird name when replacing something
• Who do not love a Big Bang release?
• Having a business sign off on a branch
is easier than on ... nothing
4 Steps in a Project Lifecycle
Start project
1
Review code
2
Build an
integration
pipeline
3
Ship feature
4
continuous
integration
best
practices
• Don’t commit broken code
• Don’t commit untested code
• If the build is broken, fix it before you
continue developing
• Don’t go home if the build is broken
• Commit frequently (at least once a day)
• Every commit must trigger the integration
• Keep the build fast (to get fast feedback)
Building an integration pipeline trunk-based!
On Merge Request
On Commit Main
Linting
Regression
Testing
Regression
Testing
Deploy CI
Linting
But … if you have a high test
coverage, it means your
code quality is good, right?
… only because you have a high test coverage,
it doesn’t mean your tests are any good….
Building an integration pipeline branch-based!
On Merge Request
Regression
testing
Linting
On Commit Main
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
On Commit …
Regression
testing
Deploy CI
Linting
Building an
integration
pipeline
branch-
based!
A bit more seriously...
• Having various kinds of branches requires
different/multiple integration pipelines
• A solid naming convention allows to make it
extremely simple
• A pipeline can be linked to a branch by a
suffix (like “feature-”, “release-” etc.)
• Integration pipelines can be custom tailored
for some special needs applying only to a
given branch
• Warning: More customization == more
work to implement it and maintain it
Building an integration pipeline branch-based!
An example of a GitLab CI/CD pipeline definition
• A condition link a job only with branches matching a name condition
4 Steps in a Project Lifecycle
Start project
1
Review code
2
Build an
integration
pipeline
3
Ship feature
4
Shipping features into prod trunk-based!
On Commit Main
Linting Testing
Deploy
Test
Deploy
Int
Deploy
Prod
Release
Deploy
CI
• The integration pipeline is extended with deployment steps
• Those steps can be triggered manually (so not every commit is
automatically pushed into prod).
Shipping features into prod branch-based!
On Commit
«Release candidate»
branch
Linting Testing
Deploy
Test
Deploy
Int
Deploy
Prod
Release
Deploy
CI
• Just what she said …
• But applied to a branch with the release candidate, every time there
is one
• Doing all the required changes in that branch, and some more
cooking
• Merge back into Main the changes, if any
Choose the git strategy that fits your project
best!  You might need to adjust one.
You can stay out of trouble if
you plan your tasks well!
• No overlapping tasks with other team
members
• Clear architecture that allows to do work
in parallel
• Clear interfaces that separate components
There are many good git branching strategies
available!  Know them!
Use Git and its
features how
they are
supposed to be
used! As a
versioning tool!
What questions do
you have?
Thank you for your time!
@jasminfluri
@G_Ceresa
The Science of
Database
CI/CD
12:00 – 12:45
Ashstead 1 & 2
References / Sources
• https://trunkbaseddevelopment.com/
• https://nvie.com/posts/a-successful-git-branching-model/

Contenu connexe

Tendances

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
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentationMack Hardy
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategiesjstack
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model abodeltae
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching modelPavlo Hodysh
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.skJuraj Hantak
 
Trunk-Based Development
Trunk-Based DevelopmentTrunk-Based Development
Trunk-Based DevelopmentBryan Liu
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHubVikram SV
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubJames Gray
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHubNicolás Tourné
 

Tendances (20)

Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
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
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
 
Gitlab flow
Gitlab flowGitlab flow
Gitlab flow
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git
GitGit
Git
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Trunk-Based Development
Trunk-Based DevelopmentTrunk-Based Development
Trunk-Based Development
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 

Similaire à Git Branching – the battle of the ages

A Ci Experience
A Ci ExperienceA Ci Experience
A Ci ExperienceUmut IŞIK
 
Trunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsTrunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsPerforce
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationXPDays
 
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 PipelinesAbhinav Gupta
 
A Business Case for Git - Tim Pettersen
A Business Case for Git - Tim PettersenA Business Case for Git - Tim Pettersen
A Business Case for Git - Tim PettersenAtlassian
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Bruno Capuano
 
Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics 丈 宮本
 
Make Your Team Flow
Make Your Team FlowMake Your Team Flow
Make Your Team FlowChad Moone
 
#spsclt18 vincent biret #spfx #devops
#spsclt18 vincent biret #spfx #devops#spsclt18 vincent biret #spfx #devops
#spsclt18 vincent biret #spfx #devopsVincent Biret
 
Webinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabWebinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabOlinData
 
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepoGit in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepoGina Bustos
 
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo Perforce
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous IntegrationSomkiat Puisungnoen
 
AgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel HarpAgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel HarpBarry Gavril
 
How HipChat Ships and Recovers Fast with DevOps Practices
How HipChat Ships and Recovers Fast with DevOps PracticesHow HipChat Ships and Recovers Fast with DevOps Practices
How HipChat Ships and Recovers Fast with DevOps PracticesAtlassian
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentChristopher Read
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Controlindiver
 

Similaire à Git Branching – the battle of the ages (20)

A Ci Experience
A Ci ExperienceA Ci Experience
A Ci Experience
 
Trunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsTrunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and Economics
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
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
 
A Business Case for Git - Tim Pettersen
A Business Case for Git - Tim PettersenA Business Case for Git - Tim Pettersen
A Business Case for Git - Tim Pettersen
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics
 
Make Your Team Flow
Make Your Team FlowMake Your Team Flow
Make Your Team Flow
 
#spsclt18 vincent biret #spfx #devops
#spsclt18 vincent biret #spfx #devops#spsclt18 vincent biret #spfx #devops
#spsclt18 vincent biret #spfx #devops
 
Enter the Team City
Enter the Team CityEnter the Team City
Enter the Team City
 
Webinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabWebinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLab
 
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepoGit in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
 
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
Git in the Enterprise: How to succeed at DevOps using Git and a monorepo
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
 
AgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel HarpAgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel Harp
 
How HipChat Ships and Recovers Fast with DevOps Practices
How HipChat Ships and Recovers Fast with DevOps PracticesHow HipChat Ships and Recovers Fast with DevOps Practices
How HipChat Ships and Recovers Fast with DevOps Practices
 
Continuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous DeploymentContinuous Integration, Build Pipelines and Continuous Deployment
Continuous Integration, Build Pipelines and Continuous Deployment
 
Git & Code review
Git & Code reviewGit & Code review
Git & Code review
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 

Plus de Jasmin Fluri

Relational Database CI/CD
Relational Database CI/CDRelational Database CI/CD
Relational Database CI/CDJasmin Fluri
 
The Science of database CICD - UKOUG Breakthrough
The Science of database CICD - UKOUG BreakthroughThe Science of database CICD - UKOUG Breakthrough
The Science of database CICD - UKOUG BreakthroughJasmin Fluri
 
Testing your data mart - how to start | DOAG 2021
Testing your data mart - how to start | DOAG 2021Testing your data mart - how to start | DOAG 2021
Testing your data mart - how to start | DOAG 2021Jasmin Fluri
 
Myth Busting - NoSQL vs SQL Data Stores - Guild42
Myth Busting - NoSQL vs SQL Data Stores - Guild42Myth Busting - NoSQL vs SQL Data Stores - Guild42
Myth Busting - NoSQL vs SQL Data Stores - Guild42Jasmin Fluri
 
Myth Busting - NoSQL vs SQL Data Stores - Video Edition
Myth Busting - NoSQL vs SQL Data Stores - Video EditionMyth Busting - NoSQL vs SQL Data Stores - Video Edition
Myth Busting - NoSQL vs SQL Data Stores - Video EditionJasmin Fluri
 
Myth Busting - NoSQL vs SQL Data Stores
Myth Busting - NoSQL vs SQL Data StoresMyth Busting - NoSQL vs SQL Data Stores
Myth Busting - NoSQL vs SQL Data StoresJasmin Fluri
 
AskTom Office Hours about Database Migrations
AskTom Office Hours about Database MigrationsAskTom Office Hours about Database Migrations
AskTom Office Hours about Database MigrationsJasmin Fluri
 
Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...
Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...
Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...Jasmin Fluri
 
Prediction of Skierdays With Oracle Data Mining - OGB EMEA Edition
Prediction of Skierdays With Oracle Data Mining - OGB EMEA EditionPrediction of Skierdays With Oracle Data Mining - OGB EMEA Edition
Prediction of Skierdays With Oracle Data Mining - OGB EMEA EditionJasmin Fluri
 
Prediction of skier days with Oracle Data Mining
Prediction of skier days with Oracle Data MiningPrediction of skier days with Oracle Data Mining
Prediction of skier days with Oracle Data MiningJasmin Fluri
 
Learnings about Automated deployments of Database Applications
Learnings about Automated deployments of Database ApplicationsLearnings about Automated deployments of Database Applications
Learnings about Automated deployments of Database ApplicationsJasmin Fluri
 
Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019
Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019
Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019Jasmin Fluri
 

Plus de Jasmin Fluri (12)

Relational Database CI/CD
Relational Database CI/CDRelational Database CI/CD
Relational Database CI/CD
 
The Science of database CICD - UKOUG Breakthrough
The Science of database CICD - UKOUG BreakthroughThe Science of database CICD - UKOUG Breakthrough
The Science of database CICD - UKOUG Breakthrough
 
Testing your data mart - how to start | DOAG 2021
Testing your data mart - how to start | DOAG 2021Testing your data mart - how to start | DOAG 2021
Testing your data mart - how to start | DOAG 2021
 
Myth Busting - NoSQL vs SQL Data Stores - Guild42
Myth Busting - NoSQL vs SQL Data Stores - Guild42Myth Busting - NoSQL vs SQL Data Stores - Guild42
Myth Busting - NoSQL vs SQL Data Stores - Guild42
 
Myth Busting - NoSQL vs SQL Data Stores - Video Edition
Myth Busting - NoSQL vs SQL Data Stores - Video EditionMyth Busting - NoSQL vs SQL Data Stores - Video Edition
Myth Busting - NoSQL vs SQL Data Stores - Video Edition
 
Myth Busting - NoSQL vs SQL Data Stores
Myth Busting - NoSQL vs SQL Data StoresMyth Busting - NoSQL vs SQL Data Stores
Myth Busting - NoSQL vs SQL Data Stores
 
AskTom Office Hours about Database Migrations
AskTom Office Hours about Database MigrationsAskTom Office Hours about Database Migrations
AskTom Office Hours about Database Migrations
 
Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...
Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...
Prediction of Skierdays with Oracle Data Mining - Analytics and Data Techcast...
 
Prediction of Skierdays With Oracle Data Mining - OGB EMEA Edition
Prediction of Skierdays With Oracle Data Mining - OGB EMEA EditionPrediction of Skierdays With Oracle Data Mining - OGB EMEA Edition
Prediction of Skierdays With Oracle Data Mining - OGB EMEA Edition
 
Prediction of skier days with Oracle Data Mining
Prediction of skier days with Oracle Data MiningPrediction of skier days with Oracle Data Mining
Prediction of skier days with Oracle Data Mining
 
Learnings about Automated deployments of Database Applications
Learnings about Automated deployments of Database ApplicationsLearnings about Automated deployments of Database Applications
Learnings about Automated deployments of Database Applications
 
Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019
Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019
Automated delivery in the data warehouse SOUG Day Romandie - 21 May 2019
 

Dernier

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Dernier (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Git Branching – the battle of the ages

  • 1. Git Branching – the battle of the ages What’s better? Extensive branching or trunk-based development? Jasmin Fluri Gianni Ceresa
  • 2. Disclaimer This presentation is intended for educational purposes only and does not replace independent professional judgment. Statements of fact and opinions expressed are those of the presenters and are subject for bias.
  • 3. Why do we need a branching strategy?
  • 5. … not having a git strategy means… some people push their changes directly to main… … others create branches, some create merge requests and expect a review… tags are sometimes created, sometimes not… … it’s a mess.
  • 6. Without a defined git strategy…
  • 7. … we need to define what happens … a branching strategy covers the FULL lifecycle … from when we start implementing a feature… … until it is installed in production!
  • 8. 2 different git strategies Jasmin Fluri Schaltstelle GmbH @jasminfluri Trunk-based development Branch-based development I first started with CVS back in ... can’t remember... Gianni Ceresa DATAlysis LLC I’m supposed to play the old man here... @G_Ceresa I’m supposed to play the young gun here... Born in the Git century – never used SVN or CVS
  • 9. The Science of Database CI/CD 12:00 – 12:45 Ashstead 1 & 2
  • 10. 4 Steps in a Project Lifecycle Start project 1 Review code 2 Build an integration pipeline 3 Ship feature 4
  • 11. 4 Steps in a Project Lifecycle Start project 1 Review code 2 Build an integration pipeline 3 Ship feature 4
  • 12. Starting a project … Trunk based development is easy!
  • 13. Trunk based does not mean you have no branches!
  • 14. Trunk-based development combines both speed (bringing changes into production fast) and safety (automated testing in the pipeline).
  • 15. Trunk based development and infrastructure code! Source: https://github.com/michaellihs/presentations/blob/main/2021-10-21-infra-pipelines-baselone/presentation.pdf
  • 16.
  • 17. Branch based development is …. Also easy! Until Jasmin finds a fun picture of it...
  • 19. GitFlow Everything can be a branch Everything “needs” a branch Once you start using branches, no reason to stop! And then you merge, merge and merge branches...
  • 20.
  • 23. Branch based development is... suggested by Oracle
  • 24. Branch based development: many ways GitFlow has been the first, presented in 2010 • In development age this is a loooooong time ago! Many more followed: • GitHubFlow • GitLabFlow • OneFlow • *whatever*-flow
  • 25. Good luck with Trunk based! Image by Anita S. from Pixabay Photo by Alexandre Debiève on Unsplash
  • 26. Or relax with Branch based! Alone Singapore Airlines
  • 27. Or relax with Branch based! Or in a team Qatar Airways
  • 28. 4 Steps in a Project Lifecycle Start project 1 Review code 2 Build an integration pipeline 3 Ship feature 4
  • 29. Code Reviews in Trunk-based Development • Either happens directly during pair programming …. • … or code reviews are very small due to very small merge requests! • But we want to avoid merging…
  • 30. Handovers in software development
  • 31. Merging is bad for you! • Merging is hard work • Merging is a change to the codebase • requires testing before and after the merge • No guarantee that integration works both before and after the merge • No branches == no merging • Small batches == short test cycles
  • 32. But we need a way to introduce changes step by step!
  • 33. Branching by Abstraction is your Friend!
  • 34. Code Reviews in Branch-based Development • Either happens directly during pair programming …. • … or code reviews happen once when the development is over before merging! • And we aren’t afraid of merging…
  • 35. Code Reviews in Branch-based • There isn’t one unique universal way for this • Heavily depends on what you are versioning and your processes • Regression testing is your friend • If you have a full set of regression tests covering your code base, no regression = no issues and you can safely merge • If you aren’t happy with the quality of the code, no issues: the branch is independent, nothing will be impacted by keeping it there and work on it again • Somebody else can easily take over a feature and keep working on the branch
  • 36. Merging can be your friend! • Again ... It all depends on what you are versioning and your processes • Not everybody is versioning just “some code” • The better your tests, the more you can “blindly” merge • Of course it requires testing before and after, but is this a bad thing? • If you have full coverage with your tests, tests are successful, there is little reason to believe something will break in an unexpected way
  • 37. Branching for real is better than “virtually” • Why branching by abstraction instead of a real branch? • No need of any “_v2” or other weird name when replacing something • Who do not love a Big Bang release? • Having a business sign off on a branch is easier than on ... nothing
  • 38. 4 Steps in a Project Lifecycle Start project 1 Review code 2 Build an integration pipeline 3 Ship feature 4
  • 39. continuous integration best practices • Don’t commit broken code • Don’t commit untested code • If the build is broken, fix it before you continue developing • Don’t go home if the build is broken • Commit frequently (at least once a day) • Every commit must trigger the integration • Keep the build fast (to get fast feedback)
  • 40. Building an integration pipeline trunk-based! On Merge Request On Commit Main Linting Regression Testing Regression Testing Deploy CI Linting
  • 41. But … if you have a high test coverage, it means your code quality is good, right?
  • 42. … only because you have a high test coverage, it doesn’t mean your tests are any good….
  • 43. Building an integration pipeline branch-based! On Merge Request Regression testing Linting On Commit Main Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting On Commit … Regression testing Deploy CI Linting
  • 44. Building an integration pipeline branch- based! A bit more seriously... • Having various kinds of branches requires different/multiple integration pipelines • A solid naming convention allows to make it extremely simple • A pipeline can be linked to a branch by a suffix (like “feature-”, “release-” etc.) • Integration pipelines can be custom tailored for some special needs applying only to a given branch • Warning: More customization == more work to implement it and maintain it
  • 45. Building an integration pipeline branch-based! An example of a GitLab CI/CD pipeline definition • A condition link a job only with branches matching a name condition
  • 46. 4 Steps in a Project Lifecycle Start project 1 Review code 2 Build an integration pipeline 3 Ship feature 4
  • 47. Shipping features into prod trunk-based! On Commit Main Linting Testing Deploy Test Deploy Int Deploy Prod Release Deploy CI • The integration pipeline is extended with deployment steps • Those steps can be triggered manually (so not every commit is automatically pushed into prod).
  • 48. Shipping features into prod branch-based! On Commit «Release candidate» branch Linting Testing Deploy Test Deploy Int Deploy Prod Release Deploy CI • Just what she said … • But applied to a branch with the release candidate, every time there is one • Doing all the required changes in that branch, and some more cooking • Merge back into Main the changes, if any
  • 49.
  • 50. Choose the git strategy that fits your project best!  You might need to adjust one.
  • 51. You can stay out of trouble if you plan your tasks well! • No overlapping tasks with other team members • Clear architecture that allows to do work in parallel • Clear interfaces that separate components
  • 52. There are many good git branching strategies available!  Know them!
  • 53. Use Git and its features how they are supposed to be used! As a versioning tool!
  • 54. What questions do you have? Thank you for your time! @jasminfluri @G_Ceresa
  • 55. The Science of Database CI/CD 12:00 – 12:45 Ashstead 1 & 2
  • 56. References / Sources • https://trunkbaseddevelopment.com/ • https://nvie.com/posts/a-successful-git-branching-model/

Notes de l'éditeur

  1. If you don’t have a defined git strategy, you won’t be fine… .. We all agree on this – there are multiple things that can go wrong and will go wrong.
  2. [GC] It looks like many people took the original Git-Flow and just did minimal changes but felt like naming the result as a new strategy.
  3. .. Let’s have a look how those two git strategies perform on these five steps in a project lifecycle
  4. .. Let’s have a look how those two git strategies perform on these five steps in a project lifecycle
  5. You either commit directly to the trunk (done in pair programming) or you work in very short lived feature branches, that get merged very quickly. We don’t need to merge a lot and because we all work on the same branch, we commit very small code changes that again reduce the risk of introducing changes. Active time of a developer is much higher… less waiting times – almost no hand-overs
  6. [GC] Everybody has its own private place where to work, nothing will be mistakenly make it into a shared branch till you really wants it. No half-releases, it’s more a Big Bang kind of release.
  7. [GC] Why to all share a wardrobe when you could have one each?
  8. [GC] Why to all share a wardrobe when you could have one each?
  9. [GC] Why to all share a wardrobe when you could have one each?
  10. .. Let’s have a look how those two git strategies perform on these five steps in a project lifecycle
  11. .. Let’s have a look how those two git strategies perform on these five steps in a project lifecycle
  12. In trunk based development, there are only two type of branches – you don’t have different rules for different branches.
  13. Every branch in gitflow workflow has its own little rules – you have a nightmare list of processes – building an automated pipeline for so many scenarios is quite a pain
  14. Every branch in gitflow workflow has its own little rules – you have a nightmare list of processes – building an automated pipeline for so many scenarios is quite a pain
  15. Every branch in gitflow workflow has its own little rules – you have a nightmare list of processes – building an automated pipeline for so many scenarios is quite a pain
  16. .. Let’s have a look how those two git strategies perform on these five steps in a project lifecycle