SlideShare una empresa de Scribd logo
1 de 21
GIT Branching Strategies
https://nl.linkedin.com/in/tizianatroukens
@tizianatroukens
Tiziana Troukens
Web Application Consultant
20/09/2016 GIT Branching Strategies 2
GIT: Concepts
20/09/2016 GIT Branching Strategies 3
GIT: Concepts
REF: pointer to an object
TAG: special REF used to mark a commit in history
20/09/2016 GIT Branching Strategies 4
GIT: Concepts
BRANCH: REF to a commit = HEAD
20/09/2016 GIT Branching Strategies 5
GIT: Branches
20/09/2016 GIT Branching Strategies 6
GIT: Branches
20/09/2016 GIT Branching Strategies 7
GIT: Merges
20/09/2016 GIT Branching Strategies 8
GIT: Concepts
MERGE: keeps the context of the feature’s commits
FAST-FORWARD MERGE: will shift the HEAD tag
20/09/2016 GIT Branching Strategies 9
Pull Requests
• Commonly 2 reviewers
• Share pull requests over the whole team
• To avoid overloading a reviewer/developer
• To spread knowledge of the codebase
• To share your ideas
• Provide a good, detailed description/ pull request name
• Preferably provide a link to a build running in an environment -> TESTING
20/09/2016 GIT Branching Strategies 10
A Succesful Git Branching Model
20/09/2016 GIT Branching Strategies 11
A Succesful Git Branching Model
20/09/2016 GIT Branching Strategies 12
A Succesful Git Branching Model
20/09/2016 GIT Branching Strategies 13
A Succesful Git Branching Model: Naming conventions
• Feature branches: “feature-*” (essentially: anything but “release-*”, “hotfix-*”, “master”, “develop”)
• Release branches: “release-*”
• Hotfix branches: “hotfix-*”
• “/” are possible, so make team-specific conventions:
• Username/workitem: “ttrouken/MT-7654”
• Username/type: “ttrouken/bugfix”
• Username/type/workitem: “ttrouken/feature/MT-7654”, “ttrouken/bugfix/ALM-85463”
• Type/description: “hotfix/pageXdoesntload”
• ...
20/09/2016 GIT Branching Strategies 14
GitHub Flow
• Simple: every feature, every bugfix, every hotfix -> create a new branch
• As soon as the feature, bugfix, hotfix is delivered -> merge back to master (pull request)
• Before a merge to master happens:
• Merge master back (rebase or merge, up to you)
• Test thoroughly, make sure code is deployable!
• Finally: create pull request to merge
• As soon as merge happened, redeploy master
• Preferably in a continuous way
20/09/2016 GIT Branching Strategies 15
GitHub Flow, but slightly different
• Simple: every feature, every bugfix, every hotfix -> create a new branch
• As soon as the feature, bugfix, hotfix is delivered -> merge to QA (pull request)
• As soon as the QA branch is approved -> merge all approved features/bugfixes/hotfixes back to master (pull request)
• Before a merge to master happens:
• Merge master back (rebase or merge, up to you)
• Test thoroughly, make sure code is deployable!
• Finally: create pull request to merge
• As soon as merge happened, redeploy master
• Preferably in a continuous way
20/09/2016 GIT Branching Strategies 16
Branch Per Platform
• One branch per platform, next to master
• “staging” -> test environment
• “QA”
• “live” -> production environment
• “integration”
• ...
• Master contains the latest development code -> could compare to “develop” in other models
• As soon as code is deployed on an environment -> code is merged to the corresponding branch
• Hotfix needed in production:
• Fix code on “live” branch
• Merge back to master
• Fix will flow through to the other branches as development continues
20/09/2016 GIT Branching Strategies 17
Branch Per Release
• One branch per release, next to master
• “Release/1”, “Release/1/1”, ...
• Release-branches are long-lived -> they can be “locked” but never removed
• Master branch keeps a good, strong, stable codebase to start release branches from
• When a release is good to go:
• Create a FEATURE branch off master
• Cherry-pick changes from RELEASE to this FEATURE
• Merge FEATURE back to master
• => release-specific changes stay in that release branch
• Why not tagging?
• Not automatically created (separate step from committing)
• Not automatically pushed (need to use “push –tags”)
20/09/2016 GIT Branching Strategies 18
Case: Telenet Workflow
• Master branch: currently on production
• RELEASE_xx.xx branches: designated release
• RELEASE_16.30, RELEASE_16.40, ... (quarterly)
• Merged from master
• FEATURE/BUGFIX branches
• Merged from RELEASE_xx.xx
• Pull requests back to RELEASE_xx.xx
• No hotfixes
• If really necessary, a PGL or emergency release can be opened
• Actually: hotfix = “new release”
20/09/2016 GIT Branching Strategies 19
Case: Telenet Workflow
• FEATURE/BUGFIX branches are never deployed
• FEATURE done:
• Pull request to RELEASE_xx.xx
• RELEASE_xx.xx gets deployed on test environment -> auto-update minor version number (16.30.2)
• Tag is created with full versioning (16.30.2)
• Remove FEATURE branch
• RELEASE done:
• RELEASE gets deployed on production
• Merge back to MASTER
• No new tag is created! Done when releasing the RELEASE_xx.xx branch
• Remove RELEASE branch
20/09/2016 GIT Branching Strategies 20
Common
• Master = production code (almost always) - stable
• Master and other “long running branches”: never commited to directly
• Merge: use merge commits
• Merge: pull request (code reviews)
• Feature branches: regularly “git rebase”
• Feature branches: merge & delete -> fully reviewed, fully tested!
• Feature/Hotfix/Bugfix branch: single deliverable
20/09/2016 GIT Branching Strategies 21

Más contenido relacionado

La actualidad más candente

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 
Git workflows
Git workflowsGit workflows
Git workflows
Xpand IT
 

La actualidad más candente (20)

A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
 
Learning git
Learning gitLearning git
Learning git
 
CI/CD with Github Actions
CI/CD with Github ActionsCI/CD with Github Actions
CI/CD with Github Actions
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Branching and Merging Practices
Branching and Merging Practices Branching and Merging Practices
Branching and Merging Practices
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
 
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyerCase Study: Migration to GitLab (from Bitbucket) at AppsFlyer
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
 
Gitlab flow
Gitlab flowGitlab flow
Gitlab flow
 
Git workflows
Git workflowsGit workflows
Git workflows
 

Similar a Git branching strategies

Similar a Git branching strategies (20)

Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using Github
 
Git_Git_Lab_1664715263.pdf
Git_Git_Lab_1664715263.pdfGit_Git_Lab_1664715263.pdf
Git_Git_Lab_1664715263.pdf
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Pr...
Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Pr...Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Pr...
Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Pr...
 
SFSCON23 - Yuri D'Elia - Automating git for development on large distributed ...
SFSCON23 - Yuri D'Elia - Automating git for development on large distributed ...SFSCON23 - Yuri D'Elia - Automating git for development on large distributed ...
SFSCON23 - Yuri D'Elia - Automating git for development on large distributed ...
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
 
Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 
Mastering GIT
Mastering GITMastering GIT
Mastering GIT
 
BRANCHING MODELS (workshop)
BRANCHING MODELS (workshop)BRANCHING MODELS (workshop)
BRANCHING MODELS (workshop)
 
Using github development process in your company
Using github development process in your companyUsing github development process in your company
Using github development process in your company
 
Git tips and tricks
Git   tips and tricksGit   tips and tricks
Git tips and tricks
 
Git basics
Git basicsGit basics
Git basics
 
Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017
Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017
Kubernetes Issues Management and Upstream Development_sahdevpzala_11302017
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Node.js what's next (Index 2018)
Node.js what's next (Index 2018)Node.js what's next (Index 2018)
Node.js what's next (Index 2018)
 
Distribute your code with NUget and build vNext
Distribute your code with NUget and build vNextDistribute your code with NUget and build vNext
Distribute your code with NUget and build vNext
 
Introduction to git flow
Introduction to git flowIntroduction to git flow
Introduction to git flow
 

Más de jstack

Más de jstack (9)

Ignite content security policy
Ignite content security policyIgnite content security policy
Ignite content security policy
 
Ignite docker
Ignite dockerIgnite docker
Ignite docker
 
Auto Merge Queue
Auto Merge QueueAuto Merge Queue
Auto Merge Queue
 
Ionic
IonicIonic
Ionic
 
Gradle
GradleGradle
Gradle
 
Flyway - database migrations made easy
Flyway - database migrations made easyFlyway - database migrations made easy
Flyway - database migrations made easy
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Ignite es6
Ignite es6Ignite es6
Ignite es6
 
Software development terminology
Software development terminologySoftware development terminology
Software development terminology
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Último (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

Git branching strategies

  • 1.
  • 2. GIT Branching Strategies https://nl.linkedin.com/in/tizianatroukens @tizianatroukens Tiziana Troukens Web Application Consultant 20/09/2016 GIT Branching Strategies 2
  • 3. GIT: Concepts 20/09/2016 GIT Branching Strategies 3
  • 4. GIT: Concepts REF: pointer to an object TAG: special REF used to mark a commit in history 20/09/2016 GIT Branching Strategies 4
  • 5. GIT: Concepts BRANCH: REF to a commit = HEAD 20/09/2016 GIT Branching Strategies 5
  • 6. GIT: Branches 20/09/2016 GIT Branching Strategies 6
  • 7. GIT: Branches 20/09/2016 GIT Branching Strategies 7
  • 8. GIT: Merges 20/09/2016 GIT Branching Strategies 8
  • 9. GIT: Concepts MERGE: keeps the context of the feature’s commits FAST-FORWARD MERGE: will shift the HEAD tag 20/09/2016 GIT Branching Strategies 9
  • 10. Pull Requests • Commonly 2 reviewers • Share pull requests over the whole team • To avoid overloading a reviewer/developer • To spread knowledge of the codebase • To share your ideas • Provide a good, detailed description/ pull request name • Preferably provide a link to a build running in an environment -> TESTING 20/09/2016 GIT Branching Strategies 10
  • 11. A Succesful Git Branching Model 20/09/2016 GIT Branching Strategies 11
  • 12. A Succesful Git Branching Model 20/09/2016 GIT Branching Strategies 12
  • 13. A Succesful Git Branching Model 20/09/2016 GIT Branching Strategies 13
  • 14. A Succesful Git Branching Model: Naming conventions • Feature branches: “feature-*” (essentially: anything but “release-*”, “hotfix-*”, “master”, “develop”) • Release branches: “release-*” • Hotfix branches: “hotfix-*” • “/” are possible, so make team-specific conventions: • Username/workitem: “ttrouken/MT-7654” • Username/type: “ttrouken/bugfix” • Username/type/workitem: “ttrouken/feature/MT-7654”, “ttrouken/bugfix/ALM-85463” • Type/description: “hotfix/pageXdoesntload” • ... 20/09/2016 GIT Branching Strategies 14
  • 15. GitHub Flow • Simple: every feature, every bugfix, every hotfix -> create a new branch • As soon as the feature, bugfix, hotfix is delivered -> merge back to master (pull request) • Before a merge to master happens: • Merge master back (rebase or merge, up to you) • Test thoroughly, make sure code is deployable! • Finally: create pull request to merge • As soon as merge happened, redeploy master • Preferably in a continuous way 20/09/2016 GIT Branching Strategies 15
  • 16. GitHub Flow, but slightly different • Simple: every feature, every bugfix, every hotfix -> create a new branch • As soon as the feature, bugfix, hotfix is delivered -> merge to QA (pull request) • As soon as the QA branch is approved -> merge all approved features/bugfixes/hotfixes back to master (pull request) • Before a merge to master happens: • Merge master back (rebase or merge, up to you) • Test thoroughly, make sure code is deployable! • Finally: create pull request to merge • As soon as merge happened, redeploy master • Preferably in a continuous way 20/09/2016 GIT Branching Strategies 16
  • 17. Branch Per Platform • One branch per platform, next to master • “staging” -> test environment • “QA” • “live” -> production environment • “integration” • ... • Master contains the latest development code -> could compare to “develop” in other models • As soon as code is deployed on an environment -> code is merged to the corresponding branch • Hotfix needed in production: • Fix code on “live” branch • Merge back to master • Fix will flow through to the other branches as development continues 20/09/2016 GIT Branching Strategies 17
  • 18. Branch Per Release • One branch per release, next to master • “Release/1”, “Release/1/1”, ... • Release-branches are long-lived -> they can be “locked” but never removed • Master branch keeps a good, strong, stable codebase to start release branches from • When a release is good to go: • Create a FEATURE branch off master • Cherry-pick changes from RELEASE to this FEATURE • Merge FEATURE back to master • => release-specific changes stay in that release branch • Why not tagging? • Not automatically created (separate step from committing) • Not automatically pushed (need to use “push –tags”) 20/09/2016 GIT Branching Strategies 18
  • 19. Case: Telenet Workflow • Master branch: currently on production • RELEASE_xx.xx branches: designated release • RELEASE_16.30, RELEASE_16.40, ... (quarterly) • Merged from master • FEATURE/BUGFIX branches • Merged from RELEASE_xx.xx • Pull requests back to RELEASE_xx.xx • No hotfixes • If really necessary, a PGL or emergency release can be opened • Actually: hotfix = “new release” 20/09/2016 GIT Branching Strategies 19
  • 20. Case: Telenet Workflow • FEATURE/BUGFIX branches are never deployed • FEATURE done: • Pull request to RELEASE_xx.xx • RELEASE_xx.xx gets deployed on test environment -> auto-update minor version number (16.30.2) • Tag is created with full versioning (16.30.2) • Remove FEATURE branch • RELEASE done: • RELEASE gets deployed on production • Merge back to MASTER • No new tag is created! Done when releasing the RELEASE_xx.xx branch • Remove RELEASE branch 20/09/2016 GIT Branching Strategies 20
  • 21. Common • Master = production code (almost always) - stable • Master and other “long running branches”: never commited to directly • Merge: use merge commits • Merge: pull request (code reviews) • Feature branches: regularly “git rebase” • Feature branches: merge & delete -> fully reviewed, fully tested! • Feature/Hotfix/Bugfix branch: single deliverable 20/09/2016 GIT Branching Strategies 21

Notas del editor

  1. A branching strategy is something you should decide on with the whole team. It defines your approach & attitude to the way you produce, track and ship code. -> the whole team should understand how the whole process works, how to collaborate, how to achieve your goal (= deliver the product) -> it is a structure of how you work -> GIT can be very flexible: search for a balance between flexibility & ease to collaborate & share code A branching strategy improves the quality of the work and the confidence & communication within the team. -> it’s sole purpose is to help you, help people. Not to help servers/networks/…, but to help them to help you. “To help you release software”. -> it’s sole purpose is to collaborate better & spend less time managing version control, but more time developing code!
  2. Branch: a POINTER to a commit! Representation in the .git directory is a simple text file containing the commit identifier of the current ‘tip’ (newest commit) on that branch. -> how is branch itself than ‘constructed’? By tracing the ancestry of that single commit -> every single commit always knowns its parent
  3. Merge commits are a bit different from normal commits: Each commit has a unique identifier (hex string), made from changeset, commit message, author, timestamp & parent commit The same commit applied to a different parent will have a different commit identifier – even if the resulting code is identical Merge commits have two parents: one from each of the branches being merged together
  4. Merging –> keep history of feature branches, in which release a merge was done –> easily ‘remove’ one full feature by simply reverting the merge commit –> easily ‘re-apply’ the same feature elsewhere, on another branch (by simply cherry-picking that one commit) –> easy to add code reviews / pull requests Fast-forward merging –> you have no pointer as to when/ in which release a merge happened –> rolling back a full feature = rolling back all commits one by one!
  5. 2 long-living (“eternal”) branches: master & develop - Should never be commited to directly, only via pull requests (code review) Master: production code Develop: code for the next big release
  6. New features -> merge feature-branch off from develop, merge back to develop only when fully done, reviewed and approved for the next release -> during development developers should ‘git rebase’ their changes onto develop regularly to avoid merge commits -> the release this feature will be in, may well be unknown at this stage!
  7. Almost ready for a new release -> merge release-branch off from develop, go to QA/Staging environment, make last bugfixes (NO NEW FEATURES), bump version -> when released, merge into master (= production code!), create tag on master and merge into develop -> bugfixes made can be merged back to develop even before going-live -> live: delete feature branch Hotfixes due in production -> merge hotfix-branch off from master, bump version & merge fix to master & develop/release-branch if existing (The essence of a hotfix is that work of team members (on the develop branch) can continue, while another person is preparing a quick production fix.) Remember: when something goes to master -> it goes to production -> CREATE A VERSIONING TAG