SlideShare a Scribd company logo
1 of 76
Download to read offline
Git Introduction
@d_danailov
Git Introduction
Dimitar Danailov
Senior Developer at 158ltd.com
dimityr.danailov[at]gmail.com
Slideshare.net
Github
YouTube
Founder at VarnaIT
Topics Today
● What is Git ?
● Git Init
● Git Branches
● Git Merging
● Git Conflicts
What is Git ?
Git is an open source,
distributed version control
system designed for speed
and efficiency
Git is an open source,
distributed version control
system designed for speed
and efficiency
Git is an open source,
distributed version control
system designed for speed
and efficiency
Centralized source control
vs
distributed version control
Centralized source control
Computer A
Checkout
File
Central VSC Server
Version Database
Version 3
Version 2
Version 1
Computer A
Checkout
File
Central VSC Server
Version Database
Version 3
Version 2
Version 1
Computer B
Checkout
File
distributed version control
Computer B
Version Database
Computer A
Version Database
Version 3
Version 2
Version 1 Version 1
Version 2
Version 3
Server Computer
Version Database
Version 3
Version 2
Version 1
Fully Distributed
(almost) everything is local
git log
git status
Git Configurations
git config --global user.name “My Name”
git config --global user.email
“myemail@example.com”
git config --global color.ui true
Create an empty Git
repository
git init
touch hello_world.rb
git add hello_world.rb
git commit
Git Clone
git clone
https://github.com/git/git
Edit files vim / emacs / etc
Stage the changes git add (file)
Review your changes git status / git diff
Commit the changes git commit
A Basic Workflow
Git Version Number
Git Branching
lightweight, movable
pointers to a commit
Branch
C1
Snapshot
git checkout -b [branch_name]
git branch
git checkout [branch_name]
git diff
git merge [branch_name]
Master
Commit
fb4d2f8
Master
Commit
fb4d2f8
Head
Head is
pointer to
current
branch
Head
git branch i18n
Master
fb4d2f8
Head
git branch i18n
Master
i18n
fb4d2f8
Head
git branch i18n
Master
i18n
fb4d2f8
$ git branch
* master
* i18n
git branch i18n
fb4d2f8
Head
i18n
$ git branch
* master
* i18n
Master
git commit
fb4d2f8
Head
i18n
Master
e1c6bf1
git commit
fb4d2f8
Head
i18n
Master
e1c6bf1
git checkout -b iss53 master
fb4d2f8
Master
e1c6bf1
Head
i18n
32ac6d1
git checkout master;
git checkout -b iss53
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
Head
iss53
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git commit
Merging
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53
Head
git checkout master
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53
Head
git merge iss53
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53
Head
git checkout master
Snapshot
fast-forward merge
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git merge iss53
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git merge i18n
non fast-forward merge
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git merge i18n
We need a
new tree
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git merge i18n
Lock History
and find best
merge base
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git merge i18n
c3d Readme.tx
f13 Hello.c
c3d Readme.tx
9ec Hello.c
3ab i18n.c
c3d Readme.tx
f13 Hello.c
5ff issue.c
fb4d2f8
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git merge i18n
c3d Readme.tx
f13 Hello.c
c3d Readme.tx
9ec Hello.c
3ab i18n.c
c3d Readme.tx
f13 Hello.c
5ff issue.c
Master
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
iss53Head
git merge i18n
c3d Readme.tx
9ec Hello.c
3ab i18n.c
c3d Readme.tx
f13 Hello.c
5ff issue.c
fb4d2f8c3d Readme.tx
f13 Hello.c
fb4d2f8c3d Readme.tx
9ec Hello.c
5ff issue.c
3ab i18n.c
iss53
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
master
git merge i18n
c3d Readme.tx
9ec Hello.c
3ab i18n.c
c3d Readme.tx
f13 Hello.c
5ff issue.c
fb4d2f8c3d Readme.tx
f13 Hello.c
fb4d2f8c3d Readme.tx
9ec Hello.c
5ff issue.c
3ab i18n.c
Head
iss53
e1c6bf1
i18n
32ac6d1
k134ab1 a18cea1
master
git merge i18n
fb4d2f8 954cba1
Head
● https://www.youtube.com/watch?v=ZDR433b0HJY&list=PLH2J_JZ4HZUtsholk1M9tQintjo-4rV8j
● http://git-scm.com/
● http://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History
Questions
Dimitar Danailov
Senior Developer at 158ltd.com
dimityr.danailov[at]gmail.com
Slideshare.net
Github
YouTube
Founder at VarnaIT

More Related Content

Viewers also liked

Viewers also liked (7)

ASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVMASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVM
 
ASP.NET - Architecting single page applications with knockout.js
ASP.NET - Architecting single page applications with knockout.jsASP.NET - Architecting single page applications with knockout.js
ASP.NET - Architecting single page applications with knockout.js
 
Angularjs Performance
Angularjs PerformanceAngularjs Performance
Angularjs Performance
 
Mongo DB Terms - Mentormate Academy
Mongo DB Terms - Mentormate AcademyMongo DB Terms - Mentormate Academy
Mongo DB Terms - Mentormate Academy
 
Microservices - Code Voyagers Sofia
Microservices - Code Voyagers SofiaMicroservices - Code Voyagers Sofia
Microservices - Code Voyagers Sofia
 
HackConf2015 - Ruby on Rails: Unexpected journey
HackConf2015 - Ruby on Rails: Unexpected journeyHackConf2015 - Ruby on Rails: Unexpected journey
HackConf2015 - Ruby on Rails: Unexpected journey
 
HackConf2016 - Ruby on Rails: Unexpected journey
HackConf2016 - Ruby on Rails: Unexpected journeyHackConf2016 - Ruby on Rails: Unexpected journey
HackConf2016 - Ruby on Rails: Unexpected journey
 

Similar to Git introduction

Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
Terry Wang
 
Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android Developer
Effective
 

Similar to Git introduction (20)

Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptx
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Git
GitGit
Git
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
Managing e commerce systems codebase with git
Managing e commerce systems codebase with gitManaging e commerce systems codebase with git
Managing e commerce systems codebase with git
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Git & github
Git & githubGit & github
Git & github
 
Introduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control systemIntroduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control system
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with Git
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through git
 
Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android Developer
 
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a BossGit Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
 
Tech thursdays / GIT
Tech thursdays / GITTech thursdays / GIT
Tech thursdays / GIT
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 

More from Dimitar Danailov

More from Dimitar Danailov (20)

Evolution - ReConnect() 2019
Evolution - ReConnect() 2019Evolution - ReConnect() 2019
Evolution - ReConnect() 2019
 
Data Visualization and D3Js
Data Visualization and D3JsData Visualization and D3Js
Data Visualization and D3Js
 
#Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03} #Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:03}
 
#Productivity - {S:01 Ep:02}
#Productivity - {S:01 Ep:02}#Productivity - {S:01 Ep:02}
#Productivity - {S:01 Ep:02}
 
#Productivity s01 ep02
#Productivity s01 ep02#Productivity s01 ep02
#Productivity s01 ep02
 
#Productivity s01 ep01
#Productivity s01 ep01#Productivity s01 ep01
#Productivity s01 ep01
 
Cloud Conf Varna - Cloud Application with AWS Lambda functions
Cloud Conf Varna - Cloud Application with AWS Lambda functionsCloud Conf Varna - Cloud Application with AWS Lambda functions
Cloud Conf Varna - Cloud Application with AWS Lambda functions
 
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
 
Building modern Progressive Web Apps with Polymer
Building modern Progressive Web Apps with PolymerBuilding modern Progressive Web Apps with Polymer
Building modern Progressive Web Apps with Polymer
 
Typescript - MentorMate Academy
Typescript - MentorMate AcademyTypescript - MentorMate Academy
Typescript - MentorMate Academy
 
Startup Europe Week - Cloud Conf Varna & GDG Varna
Startup Europe Week - Cloud Conf Varna & GDG VarnaStartup Europe Week - Cloud Conf Varna & GDG Varna
Startup Europe Week - Cloud Conf Varna & GDG Varna
 
GDG Varna - Hadoop
GDG Varna - HadoopGDG Varna - Hadoop
GDG Varna - Hadoop
 
MicroServices: Advantages ans Disadvantages
MicroServices: Advantages ans DisadvantagesMicroServices: Advantages ans Disadvantages
MicroServices: Advantages ans Disadvantages
 
GDG Varna - EcmaScript 6
GDG Varna - EcmaScript 6GDG Varna - EcmaScript 6
GDG Varna - EcmaScript 6
 
Softuni.bg - Microservices
Softuni.bg - MicroservicesSoftuni.bg - Microservices
Softuni.bg - Microservices
 
Lighting talks - Microservices
Lighting talks - MicroservicesLighting talks - Microservices
Lighting talks - Microservices
 
GDG Varna - When Android Meets Maps
GDG Varna - When Android Meets MapsGDG Varna - When Android Meets Maps
GDG Varna - When Android Meets Maps
 
ASP.NET MVC - jQuery, Minification, Json
ASP.NET MVC - jQuery, Minification, JsonASP.NET MVC - jQuery, Minification, Json
ASP.NET MVC - jQuery, Minification, Json
 
ASP.NET MVC - Javascript Overview
ASP.NET MVC - Javascript OverviewASP.NET MVC - Javascript Overview
ASP.NET MVC - Javascript Overview
 
ASP.NET MVC - Public, Private Clouds and ICN.Bg
ASP.NET MVC - Public, Private Clouds and ICN.BgASP.NET MVC - Public, Private Clouds and ICN.Bg
ASP.NET MVC - Public, Private Clouds and ICN.Bg
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Recently uploaded (20)

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
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
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 

Git introduction