SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Git
From basics to workflows
What is Version Control?
Version Control (or Revision Control) allows
tracking of changes throughout a collection of
files.
These files can be anything, but they are
typically used to track changes of files
containing code.
How does it work?
Most people know
version control in a
centralized model
(CVS, SVN), in that a
single repository
contains and controls
all change records,
logs, and other data
associated with the
project.
Master
John
Jane
Josh
What's wrong with this model?
If the master server is
down or network
connectivity is limited
to nonexistent, the
client cannot commit
new changes nor
typically access past
revisions, remote
branches, or other
information not stored
or cached locally.
Master
John
Jane
Josh
I'm helpless
Git is different
Distribution solves the
problem by making
the client and the
server the same,
ensuring everyone
has a full copy of the
Repository and any
changes made go to
the local one first
before being "pushed"
to others.
Master
John
Jane
Josh
Git is different (cont.)
This allows full, bi-
directional
communication
between any two
repos. In addition,
work is committed
locally prior to sending
off the changes to
anyone else.
Master
John
Jane
Josh
Git is different (cont.)
However, most
implementations of git
infrastructure call for a
master repository to
which contributors will
work on, similar to the
centralized model, but
ensuring each client
has exactly the same
data as the server.
Master
John
Jane
Josh
Using Git
git init
git add <file1> [...]
git commit -m "msg"
git push <remote> <branch>
git pull <remote> <branch>
git branch <branch>
git checkout <branch>
git merge <branch>
git log
git tag <tagname>
Initialize a Repository
Add File to stage area
Commit staged files
Push updates to remote
Pull remote updates
Create a new branch
Change current branch
Merge branch into current
View commit activity
Tag current state
Branches
● Are cheap
● Are local unless
pushed
● Can be merged into
each other
Branch Workflows
One common
workflow is to have a
master and develop
branch. master has
stable code, develop
is code that might not
be stable.
Programmers will
commit and push to
the develop branch
and some sort of
project leadership will
merge the develop
branch into the
master when the
time comes for a
release.
Branch Workflows (cont.)
This red line represents the master branch's
history.
master
Branch Workflows (cont.)
The blue line is the develop branch.
master
develop
Branch Workflows (cont.)
Each dot is a commit
master
develop
John:
Fixed bug
#223
Jane:
Added
Widget
Josh:
Cleaned up
doc/
directory
Branch Workflows (cont.)
Each arrow is a merge into master
master
develop
John:
Merged
develop
into master
John:
Merged
develop
into master
John:
Merged
develop
into master
Branch Workflows (cont.)
And each square is a tag
master
develop
John
Tagged:
v1.0
John
Tagged:
v1.1
John
Tagged:
v1.2
Branch Workflows (cont.)
This is the most common workflow for working
in teams. The master server will see this the
most.
master
develop
Branch Workflows (cont.)
As presented, this model is kind of limited, as
it forces everyone to put code in development
on the develop branch.
master
develop
mail-unstable
Branch Workflows (cont.)
Members of projects can create unstable
branches, branched off the develop branch, to
work on features that will make the develop
codebase unstable.
master
develop
(Delete branch)
mail-unstable
Branch Workflows (cont.)
Sometimes, however, you might need to do a
hotfix, which bypasses the typical
development cycle. This is used sparingly,
and is typically reserved for security issues.
master
develop
(Delete branch)
(Delete branch)

Mais conteúdo relacionado

Mais procurados

NSF to PST Converter
NSF to PST ConverterNSF to PST Converter
NSF to PST Convertercolleenlopez
 
Flyway _ A Database Version Management Tool
Flyway _ A Database Version Management ToolFlyway _ A Database Version Management Tool
Flyway _ A Database Version Management ToolKnoldus Inc.
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
qTest <> TestProject Integration Webinar
qTest <> TestProject Integration WebinarqTest <> TestProject Integration Webinar
qTest <> TestProject Integration WebinarKevin Dunne
 
JOIN 2021 Testable and reusable build automation Using Tekton
JOIN 2021 Testable and reusable build automation Using TektonJOIN 2021 Testable and reusable build automation Using Tekton
JOIN 2021 Testable and reusable build automation Using TektonPieter Vincken
 
Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Rafael Camacho Dejay
 
Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Malcolm Groves
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Binary Studio
 
Uop ntc 405 week 1 individual hands
Uop ntc 405 week 1 individual handsUop ntc 405 week 1 individual hands
Uop ntc 405 week 1 individual handsuopassignment
 

Mais procurados (13)

NSF to PST Converter
NSF to PST ConverterNSF to PST Converter
NSF to PST Converter
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Flyway _ A Database Version Management Tool
Flyway _ A Database Version Management ToolFlyway _ A Database Version Management Tool
Flyway _ A Database Version Management Tool
 
Convert nsf to pst
Convert nsf to pst Convert nsf to pst
Convert nsf to pst
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
qTest <> TestProject Integration Webinar
qTest <> TestProject Integration WebinarqTest <> TestProject Integration Webinar
qTest <> TestProject Integration Webinar
 
JOIN 2021 Testable and reusable build automation Using Tekton
JOIN 2021 Testable and reusable build automation Using TektonJOIN 2021 Testable and reusable build automation Using Tekton
JOIN 2021 Testable and reusable build automation Using Tekton
 
GIT
GITGIT
GIT
 
Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01
 
Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101Jenkins Declarative Pipelines 101
Jenkins Declarative Pipelines 101
 
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
Introduction to DevOps. Continuous Integration by Myroslav Dmytrus
 
Uop ntc 405 week 1 individual hands
Uop ntc 405 week 1 individual handsUop ntc 405 week 1 individual hands
Uop ntc 405 week 1 individual hands
 
Sas 9.2 eg migration v1
Sas 9.2 eg migration v1Sas 9.2 eg migration v1
Sas 9.2 eg migration v1
 

Destaque

Pentatônica menor (bass trombone & tuba)
Pentatônica menor (bass trombone & tuba)Pentatônica menor (bass trombone & tuba)
Pentatônica menor (bass trombone & tuba)Eduardo Guimarães
 
The top ten smartphones of 2013 aaaaa
The  top ten smartphones of 2013   aaaaaThe  top ten smartphones of 2013   aaaaa
The top ten smartphones of 2013 aaaaaroy_ski
 
La rentrée aldebert
La rentrée aldebertLa rentrée aldebert
La rentrée aldebertDjamila
 
The top ten smartphones of 2013 aaaaa
The  top ten smartphones of 2013   aaaaaThe  top ten smartphones of 2013   aaaaa
The top ten smartphones of 2013 aaaaaroy_ski
 
Questionnaire structure de santé 18 mai2015
Questionnaire structure de santé 18 mai2015Questionnaire structure de santé 18 mai2015
Questionnaire structure de santé 18 mai2015Augustyn Akra
 

Destaque (7)

Pentatônica menor (bass trombone & tuba)
Pentatônica menor (bass trombone & tuba)Pentatônica menor (bass trombone & tuba)
Pentatônica menor (bass trombone & tuba)
 
The top ten smartphones of 2013 aaaaa
The  top ten smartphones of 2013   aaaaaThe  top ten smartphones of 2013   aaaaa
The top ten smartphones of 2013 aaaaa
 
Teacher Training Session with Dede Wilson, Manchester June 2013
Teacher Training Session with Dede Wilson, Manchester June 2013Teacher Training Session with Dede Wilson, Manchester June 2013
Teacher Training Session with Dede Wilson, Manchester June 2013
 
La rentrée aldebert
La rentrée aldebertLa rentrée aldebert
La rentrée aldebert
 
The top ten smartphones of 2013 aaaaa
The  top ten smartphones of 2013   aaaaaThe  top ten smartphones of 2013   aaaaa
The top ten smartphones of 2013 aaaaa
 
Questionnaire structure de santé 18 mai2015
Questionnaire structure de santé 18 mai2015Questionnaire structure de santé 18 mai2015
Questionnaire structure de santé 18 mai2015
 
Zarafa
ZarafaZarafa
Zarafa
 

Semelhante a Git talk

version control system (2).pptx
version control system (2).pptxversion control system (2).pptx
version control system (2).pptxDipanshuRaj19
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLabPablo Arriazu
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego LeagueJeffrey T. Pollock
 
White Paper: Release This! - Tools for a Smooth Release Cycle
White Paper: Release This! - Tools for a Smooth Release CycleWhite Paper: Release This! - Tools for a Smooth Release Cycle
White Paper: Release This! - Tools for a Smooth Release CyclePerforce
 
Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version ControlNowell Strite
 
CS_Note_Introduction to Git Workflow.pdf
CS_Note_Introduction to Git Workflow.pdfCS_Note_Introduction to Git Workflow.pdf
CS_Note_Introduction to Git Workflow.pdfalbusfons939393
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notesSurabhi Gupta
 
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...Simplilearn
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing selfChen-Tien Tsai
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best PracticesMaidul Islam
 
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
 
Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Bhavya Chawla
 

Semelhante a Git talk (20)

Git hub_pptx
Git hub_pptxGit hub_pptx
Git hub_pptx
 
version control system (2).pptx
version control system (2).pptxversion control system (2).pptx
version control system (2).pptx
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
GIT_Overview.
GIT_Overview.GIT_Overview.
GIT_Overview.
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego League
 
White Paper: Release This! - Tools for a Smooth Release Cycle
White Paper: Release This! - Tools for a Smooth Release CycleWhite Paper: Release This! - Tools for a Smooth Release Cycle
White Paper: Release This! - Tools for a Smooth Release Cycle
 
Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
 
CS_Note_Introduction to Git Workflow.pdf
CS_Note_Introduction to Git Workflow.pdfCS_Note_Introduction to Git Workflow.pdf
CS_Note_Introduction to Git Workflow.pdf
 
Svn Basic Tutorial
Svn Basic TutorialSvn Basic Tutorial
Svn Basic Tutorial
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notes
 
Subversion
SubversionSubversion
Subversion
 
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
DevOps Interview Questions Part - 1 | Devops Interview Questions And Answers ...
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
SVN Information
SVN Information  SVN Information
SVN Information
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
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 ...
 
Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.Version Control System - for Agile Software Project Management.
Version Control System - for Agile Software Project Management.
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Git talk

  • 1. Git From basics to workflows
  • 2. What is Version Control? Version Control (or Revision Control) allows tracking of changes throughout a collection of files. These files can be anything, but they are typically used to track changes of files containing code.
  • 3. How does it work? Most people know version control in a centralized model (CVS, SVN), in that a single repository contains and controls all change records, logs, and other data associated with the project. Master John Jane Josh
  • 4. What's wrong with this model? If the master server is down or network connectivity is limited to nonexistent, the client cannot commit new changes nor typically access past revisions, remote branches, or other information not stored or cached locally. Master John Jane Josh I'm helpless
  • 5. Git is different Distribution solves the problem by making the client and the server the same, ensuring everyone has a full copy of the Repository and any changes made go to the local one first before being "pushed" to others. Master John Jane Josh
  • 6. Git is different (cont.) This allows full, bi- directional communication between any two repos. In addition, work is committed locally prior to sending off the changes to anyone else. Master John Jane Josh
  • 7. Git is different (cont.) However, most implementations of git infrastructure call for a master repository to which contributors will work on, similar to the centralized model, but ensuring each client has exactly the same data as the server. Master John Jane Josh
  • 8. Using Git git init git add <file1> [...] git commit -m "msg" git push <remote> <branch> git pull <remote> <branch> git branch <branch> git checkout <branch> git merge <branch> git log git tag <tagname> Initialize a Repository Add File to stage area Commit staged files Push updates to remote Pull remote updates Create a new branch Change current branch Merge branch into current View commit activity Tag current state
  • 9. Branches ● Are cheap ● Are local unless pushed ● Can be merged into each other
  • 10. Branch Workflows One common workflow is to have a master and develop branch. master has stable code, develop is code that might not be stable. Programmers will commit and push to the develop branch and some sort of project leadership will merge the develop branch into the master when the time comes for a release.
  • 11. Branch Workflows (cont.) This red line represents the master branch's history. master
  • 12. Branch Workflows (cont.) The blue line is the develop branch. master develop
  • 13. Branch Workflows (cont.) Each dot is a commit master develop John: Fixed bug #223 Jane: Added Widget Josh: Cleaned up doc/ directory
  • 14. Branch Workflows (cont.) Each arrow is a merge into master master develop John: Merged develop into master John: Merged develop into master John: Merged develop into master
  • 15. Branch Workflows (cont.) And each square is a tag master develop John Tagged: v1.0 John Tagged: v1.1 John Tagged: v1.2
  • 16. Branch Workflows (cont.) This is the most common workflow for working in teams. The master server will see this the most. master develop
  • 17. Branch Workflows (cont.) As presented, this model is kind of limited, as it forces everyone to put code in development on the develop branch. master develop
  • 18. mail-unstable Branch Workflows (cont.) Members of projects can create unstable branches, branched off the develop branch, to work on features that will make the develop codebase unstable. master develop (Delete branch)
  • 19. mail-unstable Branch Workflows (cont.) Sometimes, however, you might need to do a hotfix, which bypasses the typical development cycle. This is used sparingly, and is typically reserved for security issues. master develop (Delete branch) (Delete branch)