SlideShare une entreprise Scribd logo
Source Control
Basics
What is Source Control?
1 public static void main(String[] args) {
2 int a = Integer.parseInt(args[0]);
3 int b = Integer.parseInt(args[1]);
4 }
1 public static void main(String[] args) {
2 int a = Integer.parseInt(args[0]);
3 int b = Integer.parseInt(args[1]);
4 }
5
6 public int add(int a, int b) {
7 return a + b;
8 }
Change 1 Change 2
Why do we have Source Control?
1 public static void main(String[] args) {
2 int a = Integer.parseInt(args[0]);
3 int b = Integer.parseInt(args[1]);
4 }
5
6 public int add(int a, int b) {
7 return a + b;
8 }
1 public static void main(String[] args) {
2 int a = Integer.parseInt(args[0]);
3 int b = Integer.parseInt(args[1]);
4 int c = a + b;
5 System.out.println(c + “”);
6 }
7
Person 1 Person 2
Why does conflict matter?
It resulted in branching strategies for:
● Protected the codebase
● Protected the environments
● Avoiding conflict
● Knowing what went where
● Being able to get back to a stable state
All these strategies are varying degrees of wrong
Why Git?
● It dominates the market
● Most all are conceptually
similar
● It is probably what you are
already using
Git Architecture
Cloning
1 public static void main(String[] args) {
2 int a = Integer.parseInt(args[0]);
3 int b = Integer.parseInt(args[1]);
4 }
1 public static void main(String[] args) {
2 int a = Integer.parseInt(args[0]);
3 int b = Integer.parseInt(args[1]);
4 }
5
6 public int add(int a, int b) {
7 return a + b;
8 }
clone
master (remote)
master (working)
File System
Commit and Push
clone
master (remote)
master (working)
File System
commit
push
Branching
master
branch-1
branch-2
Pull Request (1)
master
branch-1
branch-2
PR-1
Automatic
Leave Open
Pull Request (2)
master
branch-1
branch-2
PR-1
Approval
Delete
Pull Request (3)
master
branch-2
PR-1
Tagging
master
commit
a000
commit
b111
commit
c222
my-tag
b111
Branches for codebase protection
Purpose Severity Solutions
From Developers Very Bad - Fire them, hire better
- Automate standards (SCA, testing, SAST)
From Other Teams Bad - Consider Pull Requests
- Ban habitual offenders
- Automate standards (SCA, testing, SAST)
- Should this be its own component?
- Should you be on the same team?
From malicious actors Bad - Automate standards (SCA, testing, SAST)
- Using tagging associated with releases
From all developers Very Bad - DevOps
Branches for env protection
Purpose Severity Solutions
From breakage Questionable - Decouple deploy from source
- Test automation
- Deploy automation
From developers Very Bad - DevOps
- Deploy automation
From change Very Bad - Don’t
Branches to avoid conflict
...is always wrong
Branches to know what went where
...is always unnecessary
master
commit
a000
commit
b111
commit
c222
Tag: 1.0.1 Tag: 1.0.2
Tag: PROD
Tag: 1.0.3
Tag:
STAGE
Branches to know the stable state
...is always unnecessary
master
commit
a000
commit
b111
commit
c222
Tag: 1.0.1 Tag: 1.0.2
Tag: PROD
Tag: 1.0.3
Tag:
STAGE

Contenu connexe

Similaire à Introduction to Git Source Control

UNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptxUNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptx
Abhishekkumarsingh630054
 
Java Language fundamental
Java Language fundamentalJava Language fundamental
Java Language fundamental
Infoviaan Technologies
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaan
walia Shaan
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
Upender Upr
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
Soumya Behera
 
pytest로 파이썬 코드 테스트하기
pytest로 파이썬 코드 테스트하기pytest로 파이썬 코드 테스트하기
pytest로 파이썬 코드 테스트하기
Yeongseon Choe
 
Pj01 4-operators and control flow
Pj01 4-operators and control flowPj01 4-operators and control flow
Pj01 4-operators and control flow
SasidharaRaoMarrapu
 
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Wooga
 
Entity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group BerlinEntity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group Berlin
Simon Schmid
 
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
it-people
 
Java program-to-add-two-matrices
Java program-to-add-two-matricesJava program-to-add-two-matrices
Java program-to-add-two-matrices
University of Essex
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressions
Logan Chien
 
Intro
IntroIntro
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
davinci54
 
Object oriented programming (first)
Object oriented programming (first)Object oriented programming (first)
Object oriented programming (first)
Hvatrex Hamam
 
arrays
arraysarrays
arrays
teach4uin
 
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen TatarynovWorkshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Fwdays
 
Java 5 and 6 New Features
Java 5 and 6 New FeaturesJava 5 and 6 New Features
Java 5 and 6 New Features
Jussi Pohjolainen
 
Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...
Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...
Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...
corehard_by
 
python-cheatsheets.pdf
python-cheatsheets.pdfpython-cheatsheets.pdf
python-cheatsheets.pdf
Kalyan969491
 

Similaire à Introduction to Git Source Control (20)

UNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptxUNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptx
 
Java Language fundamental
Java Language fundamentalJava Language fundamental
Java Language fundamental
 
Presentation1 computer shaan
Presentation1 computer shaanPresentation1 computer shaan
Presentation1 computer shaan
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
pytest로 파이썬 코드 테스트하기
pytest로 파이썬 코드 테스트하기pytest로 파이썬 코드 테스트하기
pytest로 파이썬 코드 테스트하기
 
Pj01 4-operators and control flow
Pj01 4-operators and control flowPj01 4-operators and control flow
Pj01 4-operators and control flow
 
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
Entitas System Architecture with Unity - Maxim Zaks and Simon Schmid
 
Entity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group BerlinEntity System Architecture with Unity - Unity User Group Berlin
Entity System Architecture with Unity - Unity User Group Berlin
 
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
«Отладка в Python 3.6: Быстрее, Выше, Сильнее» Елизавета Шашкова, JetBrains
 
Java program-to-add-two-matrices
Java program-to-add-two-matricesJava program-to-add-two-matrices
Java program-to-add-two-matrices
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressions
 
Intro
IntroIntro
Intro
 
DS LAB RECORD.docx
DS LAB RECORD.docxDS LAB RECORD.docx
DS LAB RECORD.docx
 
Object oriented programming (first)
Object oriented programming (first)Object oriented programming (first)
Object oriented programming (first)
 
arrays
arraysarrays
arrays
 
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen TatarynovWorkshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
 
Java 5 and 6 New Features
Java 5 and 6 New FeaturesJava 5 and 6 New Features
Java 5 and 6 New Features
 
Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...
Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...
Update on C++ Core Guidelines Lifetime Analysis. Gábor Horváth. CoreHard Spri...
 
python-cheatsheets.pdf
python-cheatsheets.pdfpython-cheatsheets.pdf
python-cheatsheets.pdf
 

Plus de John Valentino

The Path to DevOps
The Path to DevOpsThe Path to DevOps
The Path to DevOps
John Valentino
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
John Valentino
 
Introduction to Jenkins as a CI/CD Platform
Introduction to Jenkins as a CI/CD PlatformIntroduction to Jenkins as a CI/CD Platform
Introduction to Jenkins as a CI/CD Platform
John Valentino
 
Introduction to Gradle
Introduction to GradleIntroduction to Gradle
Introduction to Gradle
John Valentino
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
John Valentino
 
Roles in Software Development
Roles in Software DevelopmentRoles in Software Development
Roles in Software Development
John Valentino
 
Technology Stack
Technology StackTechnology Stack
Technology Stack
John Valentino
 
What kinds of companies do software development?
What kinds of companies do software development?What kinds of companies do software development?
What kinds of companies do software development?
John Valentino
 
Startups 101
Startups 101Startups 101
Startups 101
John Valentino
 
Benefits in Software Development
Benefits in Software DevelopmentBenefits in Software Development
Benefits in Software Development
John Valentino
 
Talking Money in Software Development
Talking Money in Software DevelopmentTalking Money in Software Development
Talking Money in Software Development
John Valentino
 
Getting Software Dev Experience
Getting  Software Dev ExperienceGetting  Software Dev Experience
Getting Software Dev Experience
John Valentino
 
Software Developer Resumes
Software Developer ResumesSoftware Developer Resumes
Software Developer Resumes
John Valentino
 
Software Recruiters
Software RecruitersSoftware Recruiters
Software Recruiters
John Valentino
 
Searching for a Software Job
Searching for a Software JobSearching for a Software Job
Searching for a Software Job
John Valentino
 
Researching a Software Job
Researching a Software JobResearching a Software Job
Researching a Software Job
John Valentino
 
Interviewing as a Developer
Interviewing as a DeveloperInterviewing as a Developer
Interviewing as a Developer
John Valentino
 
Developer: A Day in the Life
Developer: A Day in the LifeDeveloper: A Day in the Life
Developer: A Day in the Life
John Valentino
 
Agile 101
Agile 101Agile 101
Agile 101
John Valentino
 
Quality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino
 

Plus de John Valentino (20)

The Path to DevOps
The Path to DevOpsThe Path to DevOps
The Path to DevOps
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Introduction to Jenkins as a CI/CD Platform
Introduction to Jenkins as a CI/CD PlatformIntroduction to Jenkins as a CI/CD Platform
Introduction to Jenkins as a CI/CD Platform
 
Introduction to Gradle
Introduction to GradleIntroduction to Gradle
Introduction to Gradle
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Roles in Software Development
Roles in Software DevelopmentRoles in Software Development
Roles in Software Development
 
Technology Stack
Technology StackTechnology Stack
Technology Stack
 
What kinds of companies do software development?
What kinds of companies do software development?What kinds of companies do software development?
What kinds of companies do software development?
 
Startups 101
Startups 101Startups 101
Startups 101
 
Benefits in Software Development
Benefits in Software DevelopmentBenefits in Software Development
Benefits in Software Development
 
Talking Money in Software Development
Talking Money in Software DevelopmentTalking Money in Software Development
Talking Money in Software Development
 
Getting Software Dev Experience
Getting  Software Dev ExperienceGetting  Software Dev Experience
Getting Software Dev Experience
 
Software Developer Resumes
Software Developer ResumesSoftware Developer Resumes
Software Developer Resumes
 
Software Recruiters
Software RecruitersSoftware Recruiters
Software Recruiters
 
Searching for a Software Job
Searching for a Software JobSearching for a Software Job
Searching for a Software Job
 
Researching a Software Job
Researching a Software JobResearching a Software Job
Researching a Software Job
 
Interviewing as a Developer
Interviewing as a DeveloperInterviewing as a Developer
Interviewing as a Developer
 
Developer: A Day in the Life
Developer: A Day in the LifeDeveloper: A Day in the Life
Developer: A Day in the Life
 
Agile 101
Agile 101Agile 101
Agile 101
 
Quality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
 

Dernier

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 

Dernier (20)

Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 

Introduction to Git Source Control

  • 2. What is Source Control? 1 public static void main(String[] args) { 2 int a = Integer.parseInt(args[0]); 3 int b = Integer.parseInt(args[1]); 4 } 1 public static void main(String[] args) { 2 int a = Integer.parseInt(args[0]); 3 int b = Integer.parseInt(args[1]); 4 } 5 6 public int add(int a, int b) { 7 return a + b; 8 } Change 1 Change 2
  • 3. Why do we have Source Control? 1 public static void main(String[] args) { 2 int a = Integer.parseInt(args[0]); 3 int b = Integer.parseInt(args[1]); 4 } 5 6 public int add(int a, int b) { 7 return a + b; 8 } 1 public static void main(String[] args) { 2 int a = Integer.parseInt(args[0]); 3 int b = Integer.parseInt(args[1]); 4 int c = a + b; 5 System.out.println(c + “”); 6 } 7 Person 1 Person 2
  • 4. Why does conflict matter? It resulted in branching strategies for: ● Protected the codebase ● Protected the environments ● Avoiding conflict ● Knowing what went where ● Being able to get back to a stable state All these strategies are varying degrees of wrong
  • 5. Why Git? ● It dominates the market ● Most all are conceptually similar ● It is probably what you are already using
  • 7. Cloning 1 public static void main(String[] args) { 2 int a = Integer.parseInt(args[0]); 3 int b = Integer.parseInt(args[1]); 4 } 1 public static void main(String[] args) { 2 int a = Integer.parseInt(args[0]); 3 int b = Integer.parseInt(args[1]); 4 } 5 6 public int add(int a, int b) { 7 return a + b; 8 } clone master (remote) master (working) File System
  • 8. Commit and Push clone master (remote) master (working) File System commit push
  • 14. Branches for codebase protection Purpose Severity Solutions From Developers Very Bad - Fire them, hire better - Automate standards (SCA, testing, SAST) From Other Teams Bad - Consider Pull Requests - Ban habitual offenders - Automate standards (SCA, testing, SAST) - Should this be its own component? - Should you be on the same team? From malicious actors Bad - Automate standards (SCA, testing, SAST) - Using tagging associated with releases From all developers Very Bad - DevOps
  • 15. Branches for env protection Purpose Severity Solutions From breakage Questionable - Decouple deploy from source - Test automation - Deploy automation From developers Very Bad - DevOps - Deploy automation From change Very Bad - Don’t
  • 16. Branches to avoid conflict ...is always wrong
  • 17. Branches to know what went where ...is always unnecessary master commit a000 commit b111 commit c222 Tag: 1.0.1 Tag: 1.0.2 Tag: PROD Tag: 1.0.3 Tag: STAGE
  • 18. Branches to know the stable state ...is always unnecessary master commit a000 commit b111 commit c222 Tag: 1.0.1 Tag: 1.0.2 Tag: PROD Tag: 1.0.3 Tag: STAGE

Notes de l'éditeur

  1. 1.A way to keep track of incremental changes 2.Every change is a record unto itself 3.Stores that history in a central location 4.A common means of making code changes
  2. 1.Why do we have source control? 2.Because two people need to change the file around the same time 3.The result is conflict
  3. 1.I need to protect the codebase from the developers 2.I need to tie branches with environments so that I can protect them 3.We can’t have devs merging their own code, so we need them to avoid this 4.We need to use branches so that we know what goes into each environment 5.We need to be able to quickly get back into a stable state when it all goes wrong 6.Understanding why these strategies are wrong first requires knowledge about how source control works
  4. 1.An entire codebase is store at a remote location 2.Individual developers have their own local copies of that same repository 3.They push changes to that central repository, and pull changes made by other developers to it
  5. 1.When you clone, you are creating a local (working) copy from a remote location 2.On top of your local copy, is your own file system representation of that project 3.Any changes you make just remain on your file system, and don’t go into your working branch or get merged into the remote branch without explicit action
  6. 1.The only way your changes to into the working branch is via commit 2.You push your working branch into the remove branch via push
  7. 1.Master/main/mainline represents the true source 2.Each branch is a copy of the mainline at the time it is created 3.Work occurs on a branch without impacting the source branch
  8. 1.The underlying intention is to merge dev-1 back into master 2.This is best done via a Pull request, which acts like a temporary branch off of master that represents a merger of the two code bases 3.PRs can be merged automatically or require various approvals and other checks prior to be merged. 4.Another option is to either close the original branch, or leave it open
  9. 1.We have a manual approval 2.We are deleting the source branch after merger
  10. 1.Developers – The story about my first “DevOps” meeting at a new company, where it was stated “we don’t’ trust our developers” 2.Teams – This is a process, architecture, and automation problem 3.Bad actors – Very rare, but that is why tools exist. Otherwise just go back to a tagged release 4.RM in bad practice – the story
  11. 1.Env branching is generally a workaround because of a lack of automation 2.As a developer, I don’t write code that I don’t deploy. Integration and deployment is half the work. 3.The purpose of an environment is to change, so this is impossible
  12. 1.You are always just delaying the same conflict 2.Instead of dealing with them one at a time, you now have dozens and maybe even hundreds 3.This is known as anti-CI
  13. 1.Using branches to represent release is a holdover from older SCM systems like CVS and SVN 2.Tagging is your friend, because it can be used to track both what is releasable and where it was released to 3.Consider that tags are not specific to branch, but commit, which means they can be from anywhere 4.This is a key strategy when considering how to decouple coding from release
  14. Just like last slide