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

More Related Content

What's hot (20)

From SVN to Git
From SVN to GitFrom SVN to Git
From SVN to Git
Sergio Gutierrez-Santos
 
Git & gitflow
Git & gitflowGit & gitflow
Git & gitflow
Nolifelover Earn
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
Dana White
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
Mack Hardy
 
Introduction to git administration
Introduction to git administrationIntroduction to git administration
Introduction to git administration
Shawn Doyle
 
Git
GitGit
Git
Shinu Suresh
 
Git Flow - An Introduction
Git Flow - An IntroductionGit Flow - An Introduction
Git Flow - An Introduction
Knoldus Inc.
 
Git
GitGit
Git
Mayank Patel
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit 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, MavenTraining: 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 DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
Eric Guo
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
Rakesh Sukumar
 
Git workflows
Git workflowsGit workflows
Git workflows
Sergiu Savva
 
My Git workflow
My Git workflowMy Git workflow
My Git workflow
Rui Carvalho
 
Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
Hüseyin Ergin
 
Git Pull Requests
Git Pull RequestsGit Pull Requests
Git Pull Requests
Callon Campbell
 
Git presentation
Git presentationGit presentation
Git presentation
Sai Kumar Satapathy
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
Dana White
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
Mack Hardy
 
Introduction to git administration
Introduction to git administrationIntroduction to git administration
Introduction to git administration
Shawn Doyle
 
Git Flow - An Introduction
Git Flow - An IntroductionGit 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 easierGit 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, MavenTraining: 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 DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
Eric Guo
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
Rakesh Sukumar
 
Software Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and EclipseSoftware Versioning with Bitbucket and Eclipse
Software Versioning with Bitbucket and Eclipse
Hüseyin Ergin
 

Similar to An introduction to Git and GitFlow (20)

GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
Haitham Raik
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
MohanRaviRohitth
 
git Technologies
git Technologiesgit Technologies
git Technologies
Hirantha Pradeep
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to Master
C. M. Abdullah Khan
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Ahmed El-Arabawy
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
 
Intro to git
Intro to gitIntro to git
Intro to git
josh_cutler
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
Aidan Casey
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
Yeasin Abedin
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
Demo
DemoDemo
Demo
Miracle Anyanwu
 
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Ahmed El-Arabawy
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
Chen-Tien Tsai
 
Git Basics
Git BasicsGit Basics
Git Basics
Vipul Bajaj
 
Lets git to it
Lets git to itLets git to it
Lets git to it
Yoram Michaeli
 
Session: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow WorkflowSession: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow Workflow
Midhun Mohanan
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Working with Git
Working with GitWorking with Git
Working with Git
Tony Hillerson
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
Vikram SV
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to Master
C. M. Abdullah Khan
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Ahmed El-Arabawy
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
Naveen Pandey
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
Aidan Casey
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
Yeasin Abedin
 
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Ahmed El-Arabawy
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
Chen-Tien Tsai
 
Session: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow WorkflowSession: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow Workflow
Midhun Mohanan
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
Vikram SV
 
Ad

Recently uploaded (20)

Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Learn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step GuideLearn the Basics of Agile Development: Your Step-by-Step Guide
Learn the Basics of Agile Development: Your Step-by-Step Guide
Marcel David
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
"PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System""PHP and MySQL CRUD Operations for Student Management System"
"PHP and MySQL CRUD Operations for Student Management System"
Jainul Musani
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
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