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 Converter
colleenlopez
 
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
Robert Lee-Cann
 

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 (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

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
Nowell Strite
 
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 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
 

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

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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?
 

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)