SlideShare ist ein Scribd-Unternehmen logo
1 von 27
getlatestversion
Branching in Git
Ricci Gian Maria
http://www.codewrecks.com – http://blogs.ugidotnet.org/rgm -
http://www.getlatestversion.it/author/alkampfer/
alkampfer@nablasoft.com
@alkampfer
…
The
Basics
The key point in “branching” is: team need a
way to work on different version of
code/sources in parallel
We need branching
A branch in TFVC (or subversion) is a “smart
copy of a folder”, thus, they are cheating on us

Centralized VCS are Cheating
In Git the concept of “branch” is a first class
citizen
Git to the rescue
Pain points in
centralized
VCS
Folder space
Each branch is a
new folder
Each branch in centralized VCS
is a new folder.
Each folder occupy space in
client workspaces.
You need to resort to tricks for
“branch switching” (es tf get
/remap)
In Git you have a working copy and can switch
between branches with a simple command
Folder structure
Structure your folder
You need to plan for
Trunk/main before start
working
In some situation organization
of folders is dictated by
branching structure
In Git you have a working copy, the tool is taking
“snapshot” of content of that folder, no need for
special structures
The result
Resistance to branching
Team use less branching, to
minimize the pain.
When moving to Git, we have a
risk that people still fear
Branching.
If you embrace Git, but use the
same branching strategies of a
centralized VCS you are failing.
Embrace the
change
Local Branch
With local branches no one in the
team is affected by your choice on
how to parallelize your work
Rebase vs merge (rewriting history)
Flexibility on how you can reintegrate your local
branches before making your work available to
the team
Squashing
You can commit several time in a branch, but
you can made it composed by few/single
commit before reintegration
Public branches are not automatically downloaded
When you publish a branch,
other members are unaffected,
unless they decide to start
tracking that branch
Branch per
feature
Why Branch per feature
We want business people
decide which feature flow to
the next stage and when.
With branch per feature we
can “promote” branch reacting
to need of business people
Ex: Kano model
Leverage portfolio
management in
conjunction with Kano
model.
Simple TFS query to show
status of our feature and
decide when to move to
next stage of visibility
Branch per feature scares
When feature are developed in
parallel, we can have problem
during merges.
Merges are usually painful.
Monitor feature branches
In centralized VCS you should
duplicate build definitions for
Feature Branches.
For complex builds this create
some manual work to be done
each time a feature starts.
In Git a build can monitor many branches with a
single build definition
Reduce merge pain
The more a branch diverge
from its “parent”, the more
painful is merging back.
An usual solution is to
periodically reverse integration
from source to Feature Branch.
Monitor feature branches
In centralized VCS knowing if a
branch merges without conflict
is a manual process.
It is difficult to know when to
do a reverse integration to easy
merge pain
In Git you can customize a build to tell you if a
feature branch automatically merges and run a full
build merge result
Pull requests
Code review on steroids
With centralized VCS you usually
conduct a code review with patch
or similar solution (Ex. Shelveset)
To conduct a real code review, you
should create a branch where the
review can evolve.
Many hosting for Git offers the concept of pull request,
where you can ask for reintegration of a branch and have
a discussion on it
Pull refs
Some system (Es. GitHub)
automatically create and
maintain special refs for pull
request
This will have the same effect
of build customization, but
easier and with many
advantages.
Automating Feature Branches
Using Feature Branches, once
a strategy is decided, is
something that can be
automated
One of the most used strategy
is called Git Flow and is
automated even by GUI tools
like source tree
Question
http://svy.mk/1BLujLb
Per voi sono solo 10 minuti persi, per noi è
utilissimo per poter crescere e migliorare!

Weitere ähnliche Inhalte

Was ist angesagt?

TFS Build - Continuous Integration
TFS Build - Continuous IntegrationTFS Build - Continuous Integration
TFS Build - Continuous Integration
Esteban Garcia
 
Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014
Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014
Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014
Matthew Cobby
 

Was ist angesagt? (20)

Bamboo Continuous Integration Server - Brief
Bamboo Continuous Integration Server - BriefBamboo Continuous Integration Server - Brief
Bamboo Continuous Integration Server - Brief
 
Continuous integration using atlassian bamboo
Continuous integration using atlassian bambooContinuous integration using atlassian bamboo
Continuous integration using atlassian bamboo
 
Git Branching for Agile Teams
Git Branching for Agile Teams Git Branching for Agile Teams
Git Branching for Agile Teams
 
Continuous delivery with open source tools
Continuous delivery with open source toolsContinuous delivery with open source tools
Continuous delivery with open source tools
 
Enhancing Your Workflow with Environment Hub
Enhancing Your Workflow with Environment HubEnhancing Your Workflow with Environment Hub
Enhancing Your Workflow with Environment Hub
 
TFS Build - Continuous Integration
TFS Build - Continuous IntegrationTFS Build - Continuous Integration
TFS Build - Continuous Integration
 
Continuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket PipelinesContinuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket Pipelines
 
Microsoft Team Foundation Server Build 2015
Microsoft Team Foundation Server Build 2015Microsoft Team Foundation Server Build 2015
Microsoft Team Foundation Server Build 2015
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
How We Use GitHub
How We Use GitHubHow We Use GitHub
How We Use GitHub
 
Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014
Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014
Practical Continuous Deployment - Atlassian - London AUG 18 Feb 2014
 
Continuous integration using Bamboo
Continuous integration using BambooContinuous integration using Bamboo
Continuous integration using Bamboo
 
Release Management in TFS 2015
Release Management in TFS 2015Release Management in TFS 2015
Release Management in TFS 2015
 
Jenkins Reviewbot
Jenkins ReviewbotJenkins Reviewbot
Jenkins Reviewbot
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
 
Ordina SOFTC Presentation - Deployment with TFS Build and Workflow
Ordina SOFTC Presentation - Deployment with TFS Build and WorkflowOrdina SOFTC Presentation - Deployment with TFS Build and Workflow
Ordina SOFTC Presentation - Deployment with TFS Build and Workflow
 
Enter the Team City
Enter the Team CityEnter the Team City
Enter the Team City
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1
 
Tfs 2015 Upgrade Tips and Tricks
Tfs 2015 Upgrade Tips and TricksTfs 2015 Upgrade Tips and Tricks
Tfs 2015 Upgrade Tips and Tricks
 
Production Ready WordPress #WPLDN
Production Ready WordPress #WPLDNProduction Ready WordPress #WPLDN
Production Ready WordPress #WPLDN
 

Ähnlich wie Git branching model

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
Nowell Strite
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
Mehdi Khalili
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
François D'Agostini
 

Ähnlich wie Git branching model (20)

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
 
Introduction to Git (part 3)
Introduction to Git (part 3)Introduction to Git (part 3)
Introduction to Git (part 3)
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git Pull Requests
Git Pull RequestsGit Pull Requests
Git Pull Requests
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
CoDe:U git flow
CoDe:U git flowCoDe:U git flow
CoDe:U git flow
 
Gitting better
Gitting betterGitting better
Gitting better
 
Git Workflows
Git WorkflowsGit Workflows
Git Workflows
 
Getting Git
Getting GitGetting Git
Getting Git
 
Git flow
Git flowGit flow
Git flow
 
Git How Does That Work Then
Git How Does That Work ThenGit How Does That Work Then
Git How Does That Work Then
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
 
Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs Subversion: ¿Cuando elegir uno u otro?
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
 
Team Foundation Server - Source Control
Team Foundation Server - Source ControlTeam Foundation Server - Source Control
Team Foundation Server - Source Control
 
SVN Information
SVN Information  SVN Information
SVN Information
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
 

Mehr von Gian Maria Ricci

Automatically deployment to Azure Web Sites
Automatically deployment to Azure Web SitesAutomatically deployment to Azure Web Sites
Automatically deployment to Azure Web Sites
Gian Maria Ricci
 
Porfolio Management in TFS 2013
Porfolio Management in TFS 2013Porfolio Management in TFS 2013
Porfolio Management in TFS 2013
Gian Maria Ricci
 

Mehr von Gian Maria Ricci (20)

Se non sviluppo codice non sto lavorando
Se non sviluppo codice non sto lavorandoSe non sviluppo codice non sto lavorando
Se non sviluppo codice non sto lavorando
 
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure DevopsGestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
Gestire la qualità del codice con Visual Studio, SonarQube ed Azure Devops
 
Migrare da un VCS centralizzato a Git
Migrare da un VCS centralizzato a GitMigrare da un VCS centralizzato a Git
Migrare da un VCS centralizzato a Git
 
Real World Build + Release automation in Azure DevOps
Real World Build + Release automation in Azure DevOpsReal World Build + Release automation in Azure DevOps
Real World Build + Release automation in Azure DevOps
 
Gestire i rilasci automatici con azure devops
Gestire i rilasci automatici con azure devopsGestire i rilasci automatici con azure devops
Gestire i rilasci automatici con azure devops
 
Build and release in code with azure devops pipelines
Build and release in code with azure devops pipelinesBuild and release in code with azure devops pipelines
Build and release in code with azure devops pipelines
 
Azure Pipeline in salsa yaml
Azure Pipeline in salsa yamlAzure Pipeline in salsa yaml
Azure Pipeline in salsa yaml
 
Git gitflow pull requests in devops focused teams
Git gitflow pull requests in devops focused teamsGit gitflow pull requests in devops focused teams
Git gitflow pull requests in devops focused teams
 
Manage your environment with DSC
Manage your environment with DSCManage your environment with DSC
Manage your environment with DSC
 
TFS - Quale source control
TFS - Quale source controlTFS - Quale source control
TFS - Quale source control
 
Branch model in Git
Branch model in GitBranch model in Git
Branch model in Git
 
Introduction to Visual Studio Online
Introduction to Visual Studio OnlineIntroduction to Visual Studio Online
Introduction to Visual Studio Online
 
Git si o Git No
Git si o Git NoGit si o Git No
Git si o Git No
 
Testing
TestingTesting
Testing
 
Come Organizzare il proprio Team Project
Come Organizzare il proprio Team ProjectCome Organizzare il proprio Team Project
Come Organizzare il proprio Team Project
 
Git Perchè Usarlo
Git Perchè UsarloGit Perchè Usarlo
Git Perchè Usarlo
 
Automatically deployment to Azure Web Sites
Automatically deployment to Azure Web SitesAutomatically deployment to Azure Web Sites
Automatically deployment to Azure Web Sites
 
Porfolio Management in TFS 2013
Porfolio Management in TFS 2013Porfolio Management in TFS 2013
Porfolio Management in TFS 2013
 
TFS or Team Foundation Service?
TFS or Team Foundation Service?TFS or Team Foundation Service?
TFS or Team Foundation Service?
 
Typical Developer Day
Typical Developer DayTypical Developer Day
Typical Developer Day
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Git branching model

  • 1. getlatestversion Branching in Git Ricci Gian Maria http://www.codewrecks.com – http://blogs.ugidotnet.org/rgm - http://www.getlatestversion.it/author/alkampfer/ alkampfer@nablasoft.com @alkampfer …
  • 3. The key point in “branching” is: team need a way to work on different version of code/sources in parallel We need branching
  • 4. A branch in TFVC (or subversion) is a “smart copy of a folder”, thus, they are cheating on us  Centralized VCS are Cheating
  • 5. In Git the concept of “branch” is a first class citizen Git to the rescue
  • 7. Folder space Each branch is a new folder Each branch in centralized VCS is a new folder. Each folder occupy space in client workspaces. You need to resort to tricks for “branch switching” (es tf get /remap) In Git you have a working copy and can switch between branches with a simple command
  • 8. Folder structure Structure your folder You need to plan for Trunk/main before start working In some situation organization of folders is dictated by branching structure In Git you have a working copy, the tool is taking “snapshot” of content of that folder, no need for special structures
  • 9. The result Resistance to branching Team use less branching, to minimize the pain. When moving to Git, we have a risk that people still fear Branching. If you embrace Git, but use the same branching strategies of a centralized VCS you are failing.
  • 11. Local Branch With local branches no one in the team is affected by your choice on how to parallelize your work
  • 12. Rebase vs merge (rewriting history) Flexibility on how you can reintegrate your local branches before making your work available to the team
  • 13. Squashing You can commit several time in a branch, but you can made it composed by few/single commit before reintegration
  • 14. Public branches are not automatically downloaded When you publish a branch, other members are unaffected, unless they decide to start tracking that branch
  • 16. Why Branch per feature We want business people decide which feature flow to the next stage and when. With branch per feature we can “promote” branch reacting to need of business people
  • 17. Ex: Kano model Leverage portfolio management in conjunction with Kano model. Simple TFS query to show status of our feature and decide when to move to next stage of visibility
  • 18. Branch per feature scares When feature are developed in parallel, we can have problem during merges. Merges are usually painful.
  • 19. Monitor feature branches In centralized VCS you should duplicate build definitions for Feature Branches. For complex builds this create some manual work to be done each time a feature starts. In Git a build can monitor many branches with a single build definition
  • 20. Reduce merge pain The more a branch diverge from its “parent”, the more painful is merging back. An usual solution is to periodically reverse integration from source to Feature Branch.
  • 21. Monitor feature branches In centralized VCS knowing if a branch merges without conflict is a manual process. It is difficult to know when to do a reverse integration to easy merge pain In Git you can customize a build to tell you if a feature branch automatically merges and run a full build merge result
  • 23. Code review on steroids With centralized VCS you usually conduct a code review with patch or similar solution (Ex. Shelveset) To conduct a real code review, you should create a branch where the review can evolve. Many hosting for Git offers the concept of pull request, where you can ask for reintegration of a branch and have a discussion on it
  • 24. Pull refs Some system (Es. GitHub) automatically create and maintain special refs for pull request This will have the same effect of build customization, but easier and with many advantages.
  • 25. Automating Feature Branches Using Feature Branches, once a strategy is decided, is something that can be automated One of the most used strategy is called Git Flow and is automated even by GUI tools like source tree
  • 27. http://svy.mk/1BLujLb Per voi sono solo 10 minuti persi, per noi è utilissimo per poter crescere e migliorare!