SlideShare a Scribd company logo
An introduction to Git and GitFlow
(& how we use Git at Marie Curie)
Mark Everard / @ev2000
Technical Lead
What is Git?
• Git is a revision control system
• Originally developed by Linus
Torvalds (Linux Emperor!)
• It is a distributed version control
system
• Very very widely used
42.9% May 2014, 36.3% May 2013
Full stats from https://en.wikipedia.org/wiki/Git_(software)
Its like SVN right?
It is and it isn’t
• It serves the same purpose
It does it in a very different way
• Has a steeper learning curve than SVN
• Different terminology
• Have to unlearn some SVN
‘knowledge’
Key differences
• You checkout / clone a complete
source control repository
• You have the entire history of the
repository on your machine
• Simplifies merging – everything in
Git is a branch
https://git.wiki.kernel.org/index.php/GitSvnComparsion
Common git terminology
ORIGIN
Your centralised repository (for us
this is GitHub – though in true
DVCS there isn’t one)
HEAD
Where your current repository
points.. Most of the time this is
the latest revision in your branch
Common git commands
Command line FTW 
Git command
> git status Review what changes you’ve
made
> git add <files> Stages files for a commit (allows
you to choose what to add)
> git commit <files> Commit file to your HEAD
source control
Common git commands
Command line FTW 
Git command
> git pull Pull down and merge commits
from a remote repository
> git push <remote> Push commits to a remote
repository
> git remote Lists all remotes that you have
configured. You will generally
have one (from GitHub)
Common git commands
Sh*t I’ve made a mistake – how to undo
Git command
> git reset HEAD~2
(moves your head back two revisions)
Undo changes that haven’t
been shared with anyone else.
Git will GC the dangling
commits
> git checkout HEAD~2
(moves your head back two revisions)
Inspect what the state was 2
commits ago.
Will detach head (meaning it
doesn’t have a branch - BAD)
> git revert HEAD~2 Reverting undoes a commit by
creating a new commit (exactly
what you’d do manually)
Tooling
• One area where SVN is more
advanced than Git
• If you understand the basic
commands GUI’s will make more
sense
• Pick one as a team, you can then
support each other.
My favourite is SourceTree
Principles
• If it’s not in source control, it
doesn’t exist
• Commit early, commit often
• Always inspect your changes
before committing
• Remember the axe-murderer
when writing commit messages
Work flows
• Git’s power actually comes from
how you use it
• SVN has a simple and rigid
workflow (trunk, tags, branches)
• Git offers many different type of
workflows to suit different sized
teams and release strategies
Simple Flow
Good for small development teams
and definite schedules
Branch name Usage Rules
master Represents the current code
base that is deployed to
production servers
• Releases are taken from master
• master should only be committed
too directly in the case of a hotfix
• Any direct commits should be up-
merged to develop
develop Represents the work-in-
progress of all changes that
are being made on the
project
• develop should be merged to
master for a release
• release should not be made
directly from develop
Git Flow
For complex multiple teams projects
allowing flexible releases
(feature branching)
Git Flow
For complex multiple teams projects
allowing flexible releases
• Strict branching model
• Feature branching
GitFlow
https://www.atlassian.com/git/tutorials/comp
aring-workflows/feature-branch-workflow
Branch name Usage Rules
master Represents the current code
base that is deployed to
production servers
• Releases are taken from master
• master should only be committed too directly
in the case of a hotfix
• Any direct commits should be up-merged to
develop
develop Represents the current
release candidate
• develop should be merged to master for a
release
• release should not be made directly from
develop
feature branches Represent a single in-
progress feature
• Must branch from develop
• Must merge to develop
• Regular up-merging from develop should take
place
• Only merged to develop when QA is passed
• Branches should be deleted when feature is
merged
release branches Represents a finalised
release candidate
• Must branch from develop
• Must merge to master and develop
• Bug fixes found during the UAT / Regression
periods should be committed here
• When the branch is ready to release, it should
be merged to master and develop.
• After the above merges / deployment the
release branch should be deleted
hotfix branches Represents a fix for an urgent
issue found in production
• Must branch from master
• Must merge to master and develop
• Branch should be deleted post merge
• Never release from a hotfix branch
Branch naming
The following conventions apply. General rules are to be
descriptive and to allow the team to understand the
feature.
• release branches should be named
release/{release-name}
e.g. release/sprint-28 or release/picturewall-phase-1
• feature branches should be name
feature/{name-JIRA-story/epic-number}
e.g. feature/blog-bcweb-594 or feature/picturegallery-dam-4
• hotfix branches should be named
hotfix/{JIRA-bug-number}
e.g. hotfix/bcweb-3601 or hotfix/dam-90
An introduction to Git and GitFlow
Ad

Recommended

Gitflow - Una metología para manejo de Branches
Gitflow - Una metología para manejo de Branches
Javier Alvarez
 
Git flow for daily use
Git flow for daily use
Mediacurrent
 
Git Workflow With Gitflow
Git Workflow With Gitflow
Josh Dvir
 
Git flow Introduction
Git flow Introduction
David Paluy
 
Pubmi gitflow
Pubmi gitflow
Simone Gentili
 
Git and git flow
Git and git flow
Fran García
 
19 GitFlow #burningkeyboards
19 GitFlow #burningkeyboards
Denis Ristic
 
Git flow
Git flow
Suraj Aair
 
From SVN to Git
From SVN to Git
Sergio Gutierrez-Santos
 
Git & gitflow
Git & gitflow
Nolifelover Earn
 
Git with the flow
Git with the flow
Dana White
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Git workflows presentation
Git workflows presentation
Mack Hardy
 
Introduction to git administration
Introduction to git administration
Shawn Doyle
 
Git
Git
Shinu Suresh
 
Git Flow - An Introduction
Git Flow - An Introduction
Knoldus Inc.
 
Git
Git
Mayank Patel
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, Maven
Artur Ventura
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
Git extension-training
Git extension-training
Eric Guo
 
Introduction to github slideshare
Introduction to github slideshare
Rakesh Sukumar
 
Git workflows
Git workflows
Sergiu Savva
 
My Git workflow
My Git workflow
Rui Carvalho
 
Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
Hüseyin Ergin
 
Git Pull Requests
Git Pull Requests
Callon Campbell
 
Git presentation
Git presentation
Sai Kumar Satapathy
 
Subversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)
Yeasin Abedin
 
Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 

More Related Content

What's hot (20)

From SVN to Git
From SVN to Git
Sergio Gutierrez-Santos
 
Git & gitflow
Git & gitflow
Nolifelover Earn
 
Git with the flow
Git with the flow
Dana White
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Git workflows presentation
Git workflows presentation
Mack Hardy
 
Introduction to git administration
Introduction to git administration
Shawn Doyle
 
Git
Git
Shinu Suresh
 
Git Flow - An Introduction
Git Flow - An Introduction
Knoldus Inc.
 
Git
Git
Mayank Patel
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, Maven
Artur Ventura
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
Git extension-training
Git extension-training
Eric Guo
 
Introduction to github slideshare
Introduction to github slideshare
Rakesh Sukumar
 
Git workflows
Git workflows
Sergiu Savva
 
My Git workflow
My Git workflow
Rui Carvalho
 
Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
Hüseyin Ergin
 
Git Pull Requests
Git Pull Requests
Callon Campbell
 
Git presentation
Git presentation
Sai Kumar Satapathy
 
Subversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Git with the flow
Git with the flow
Dana White
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Git workflows presentation
Git workflows presentation
Mack Hardy
 
Introduction to git administration
Introduction to git administration
Shawn Doyle
 
Git Flow - An Introduction
Git Flow - An Introduction
Knoldus Inc.
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Training: Day Two - Eclipse, Git, Maven
Training: Day Two - Eclipse, Git, Maven
Artur Ventura
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
Git extension-training
Git extension-training
Eric Guo
 
Introduction to github slideshare
Introduction to github slideshare
Rakesh Sukumar
 
Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
Hüseyin Ergin
 

Similar to An introduction to Git and GitFlow (20)

Git usage (Basics and workflow)
Git usage (Basics and workflow)
Yeasin Abedin
 
Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Git with t for teams
Git with t for teams
Sven Peters
 
Lets git to it
Lets git to it
Yoram Michaeli
 
Git basics a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
François D'Agostini
 
Intro to Gitflow
Intro to Gitflow
Ben Speakmon
 
Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright
Shunsuke (Sean) Osawa
 
01 - Git vs SVN
01 - Git vs SVN
Edward Goikhman
 
Improving your workflow with git
Improving your workflow with git
Dídac Ríos
 
Git & GitLab
Git & GitLab
Gaurav Wable
 
Git
Git
Vijay Kani
 
Git tips and tricks
Git tips and tricks
Chris Ballance
 
HPLN Meet Git - Public
HPLN Meet Git - Public
Liran Tal
 
Introduction to git
Introduction to git
Nguyen Van Hung
 
Tool Development A - Git
Tool Development A - Git
Nick Pruehs
 
3 Git
3 Git
Fabio Fumarola
 
GIT In Detail
GIT In Detail
Haitham Raik
 
Git and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
GIT INTRODUCTION
GIT INTRODUCTION
MohanRaviRohitth
 
Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015
Atlassian 대한민국
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)
Yeasin Abedin
 
Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Git with t for teams
Git with t for teams
Sven Peters
 
Git basics a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
François D'Agostini
 
Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright
Shunsuke (Sean) Osawa
 
Improving your workflow with git
Improving your workflow with git
Dídac Ríos
 
HPLN Meet Git - Public
HPLN Meet Git - Public
Liran Tal
 
Tool Development A - Git
Tool Development A - Git
Nick Pruehs
 
Git and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
Ad

Recently uploaded (20)

OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Daily Lesson Log MATATAG ICT TEchnology 8
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Securing AI - There Is No Try, Only Do!.pdf
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Ad

An introduction to Git and GitFlow

  • 1. An introduction to Git and GitFlow (& how we use Git at Marie Curie) Mark Everard / @ev2000 Technical Lead
  • 2. What is Git? • Git is a revision control system • Originally developed by Linus Torvalds (Linux Emperor!) • It is a distributed version control system • Very very widely used 42.9% May 2014, 36.3% May 2013 Full stats from https://en.wikipedia.org/wiki/Git_(software)
  • 3. Its like SVN right? It is and it isn’t • It serves the same purpose It does it in a very different way • Has a steeper learning curve than SVN • Different terminology • Have to unlearn some SVN ‘knowledge’
  • 4. Key differences • You checkout / clone a complete source control repository • You have the entire history of the repository on your machine • Simplifies merging – everything in Git is a branch https://git.wiki.kernel.org/index.php/GitSvnComparsion
  • 5. Common git terminology ORIGIN Your centralised repository (for us this is GitHub – though in true DVCS there isn’t one) HEAD Where your current repository points.. Most of the time this is the latest revision in your branch
  • 6. Common git commands Command line FTW  Git command > git status Review what changes you’ve made > git add <files> Stages files for a commit (allows you to choose what to add) > git commit <files> Commit file to your HEAD source control
  • 7. Common git commands Command line FTW  Git command > git pull Pull down and merge commits from a remote repository > git push <remote> Push commits to a remote repository > git remote Lists all remotes that you have configured. You will generally have one (from GitHub)
  • 8. Common git commands Sh*t I’ve made a mistake – how to undo Git command > git reset HEAD~2 (moves your head back two revisions) Undo changes that haven’t been shared with anyone else. Git will GC the dangling commits > git checkout HEAD~2 (moves your head back two revisions) Inspect what the state was 2 commits ago. Will detach head (meaning it doesn’t have a branch - BAD) > git revert HEAD~2 Reverting undoes a commit by creating a new commit (exactly what you’d do manually)
  • 9. Tooling • One area where SVN is more advanced than Git • If you understand the basic commands GUI’s will make more sense • Pick one as a team, you can then support each other. My favourite is SourceTree
  • 10. Principles • If it’s not in source control, it doesn’t exist • Commit early, commit often • Always inspect your changes before committing • Remember the axe-murderer when writing commit messages
  • 11. Work flows • Git’s power actually comes from how you use it • SVN has a simple and rigid workflow (trunk, tags, branches) • Git offers many different type of workflows to suit different sized teams and release strategies
  • 12. Simple Flow Good for small development teams and definite schedules Branch name Usage Rules master Represents the current code base that is deployed to production servers • Releases are taken from master • master should only be committed too directly in the case of a hotfix • Any direct commits should be up- merged to develop develop Represents the work-in- progress of all changes that are being made on the project • develop should be merged to master for a release • release should not be made directly from develop
  • 13. Git Flow For complex multiple teams projects allowing flexible releases (feature branching)
  • 14. Git Flow For complex multiple teams projects allowing flexible releases • Strict branching model • Feature branching
  • 16. Branch name Usage Rules master Represents the current code base that is deployed to production servers • Releases are taken from master • master should only be committed too directly in the case of a hotfix • Any direct commits should be up-merged to develop develop Represents the current release candidate • develop should be merged to master for a release • release should not be made directly from develop feature branches Represent a single in- progress feature • Must branch from develop • Must merge to develop • Regular up-merging from develop should take place • Only merged to develop when QA is passed • Branches should be deleted when feature is merged release branches Represents a finalised release candidate • Must branch from develop • Must merge to master and develop • Bug fixes found during the UAT / Regression periods should be committed here • When the branch is ready to release, it should be merged to master and develop. • After the above merges / deployment the release branch should be deleted hotfix branches Represents a fix for an urgent issue found in production • Must branch from master • Must merge to master and develop • Branch should be deleted post merge • Never release from a hotfix branch
  • 17. Branch naming The following conventions apply. General rules are to be descriptive and to allow the team to understand the feature. • release branches should be named release/{release-name} e.g. release/sprint-28 or release/picturewall-phase-1 • feature branches should be name feature/{name-JIRA-story/epic-number} e.g. feature/blog-bcweb-594 or feature/picturegallery-dam-4 • hotfix branches should be named hotfix/{JIRA-bug-number} e.g. hotfix/bcweb-3601 or hotfix/dam-90