SlideShare a Scribd company logo
Crash course in Git and Github
www.skewcode.com
Table of Contents
● DVCS
● Git - Installation
● Git - Basic concepts
● Git - Branches
● Git - Remotes
● Git - Remote tracking branches
● Git - Merging
● References
Distributed version control system
v2
CENTRAL REPOSITORY
VERSION HISTORY
v1 v3 v2v1 v3
CENTRAL REPOSITORY
VERSION HISTORY
v2v1 v3
COMPUTER A
VERSION HISTORY
v2v1 v3
COMPUTER B
VERSION HISTORY
DVCS
COMPUTER A COMPUTER B
VCS
FILE 1
FILE 2
FILE 4
FILE 5
Git - Installation
Installation
○ https://git-scm.com/
○ sudo apt-get install git-all
○ brew install git
Configuration
○ git config --global user.name "Rahul Sharma"
○ git config --global user.email rahulsharma@gmail.com
○ git config --global color.ui auto
○ git config --global core.editor "code --wait"
○ git config --list
Git - Installation
Creating a new local repository
● mkdir mysourcerepo
● cd mysourcerepo
● git init
Cloning an existing remote repository
● mkdir mysourcerepo
● git clone https://github.com/skewcode/101-github.git mysourcerepo
Git - Basic Concepts
working directory
staging area (index)Local repository / commits (.git folder)
git add
git commit
X1
X1X1
git diff
git diff --staged
Remote repository / commits (github)
X1
git push
git status
git fetch
or
git pull
Git - Basic Concepts
working directory
staging area (index)Local repository / commits (.git folder)
git add
git commit
X1
X1X2X1
X2
X2
git log
Git - Remotes
Local repository
Remote repository (github)
git remote -v
https://github.com/skewcode/101-gitdemo.git
Git - Branches
working directory
staging area (index)Local repository (commits)
git add
git commit
X1
X1X2X1
X2
X2
mastermaster
X3
X3X3
master
Git - Branches
working directory
staging area (index)Local repository (commits)
git add
git commit
X1
X1X2X1
X2
X2
mastermaster
X3
X3
X3
devbranch
devbranch
git branch devbranch
git checkout devbranch
X4
master
git checkout master
X4
X4
Git - Remote tracking branches
Local repository
X2X1 X3
master
X2 X3X1
mastermastermaster
origin/master
Remote repository
git fetch origin
X4
master
X5
master
X4
origin/master
git branch -vv
Git - Merging (fast-forward)
working directory
staging area (index)Local repository (commits)
git add
git commit
X1
X1X2X1
X2
X2
mastermaster
X3
X3X3
devbranch devbranch
git branch devbranch
git checkout devbranch
master
git checkout master
git merge devbranch
Git - Merging (three-way)
working directory
staging area (index)Local repository (commits)
git add
git commit
X1
X1X2X1
X2
X2
mastermaster
X3
X3
X3
devbranch
devbranch
git branch devbranch
git checkout devbranch
X4
master
git checkout master
X4
X4
git merge devbranch
X5
master
References
● https://git-scm.com/book/en/v2

More Related Content

What's hot

Introduction of Distributed version control system (mainly Mercurial)
Introduction of Distributed version control system (mainly Mercurial)Introduction of Distributed version control system (mainly Mercurial)
Introduction of Distributed version control system (mainly Mercurial)
Fred Lin
 
Git dvcs and Information Security Review
Git dvcs and Information Security ReviewGit dvcs and Information Security Review
Git dvcs and Information Security Review
dchaffiol
 
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
Jay Bryant
 
Putting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipsterPutting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipster
Gerard Gigliotti
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to GitConFoo
 
Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)
Jay Bryant
 
BKK16-215 kernelci.org: beyond boot testing
BKK16-215 kernelci.org: beyond boot testingBKK16-215 kernelci.org: beyond boot testing
BKK16-215 kernelci.org: beyond boot testing
Linaro
 
BKK16-507 AOSP builds of Linaro with CI v2
BKK16-507 AOSP builds of Linaro with CI v2BKK16-507 AOSP builds of Linaro with CI v2
BKK16-507 AOSP builds of Linaro with CI v2
Linaro
 
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
Jay Bryant
 
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Jay Bryant
 
Git.odp 0
Git.odp 0Git.odp 0
Git.odp 0
Mannu Malhotra
 
Open source
Open sourceOpen source
Open source
onaelmangabo
 
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDKubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Sunnyvale
 
Beginner's guide to git
Beginner's guide to gitBeginner's guide to git
Beginner's guide to git
Lim Sim
 
Advanted git
Advanted git Advanted git
Advanted git
Sahil Gupta
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17siva ram
 
Hyperscale SIG Introduction
Hyperscale SIG IntroductionHyperscale SIG Introduction
Hyperscale SIG Introduction
Davide Cavalca
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
sparkfabrik
 

What's hot (20)

Introduction of Distributed version control system (mainly Mercurial)
Introduction of Distributed version control system (mainly Mercurial)Introduction of Distributed version control system (mainly Mercurial)
Introduction of Distributed version control system (mainly Mercurial)
 
Git dvcs and Information Security Review
Git dvcs and Information Security ReviewGit dvcs and Information Security Review
Git dvcs and Information Security Review
 
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017OpenStack Cinder On-Boarding Education - Boston Summit - 2017
OpenStack Cinder On-Boarding Education - Boston Summit - 2017
 
Putting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipsterPutting the Fun into Functioning CI/CD with JHipster
Putting the Fun into Functioning CI/CD with JHipster
 
Pragmatic Guide to Git
Pragmatic Guide to GitPragmatic Guide to Git
Pragmatic Guide to Git
 
Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)Cinder On-boarding Room - Berlin (11-13-2018)
Cinder On-boarding Room - Berlin (11-13-2018)
 
BKK16-215 kernelci.org: beyond boot testing
BKK16-215 kernelci.org: beyond boot testingBKK16-215 kernelci.org: beyond boot testing
BKK16-215 kernelci.org: beyond boot testing
 
BKK16-507 AOSP builds of Linaro with CI v2
BKK16-507 AOSP builds of Linaro with CI v2BKK16-507 AOSP builds of Linaro with CI v2
BKK16-507 AOSP builds of Linaro with CI v2
 
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
OpenStack Cinder On-Boarding Room - Vancouver Summit 2018
 
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019Cinder Project On-Boarding - OpenInfra Summit Denver 2019
Cinder Project On-Boarding - OpenInfra Summit Denver 2019
 
Git.odp 0
Git.odp 0Git.odp 0
Git.odp 0
 
Open source
Open sourceOpen source
Open source
 
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDKubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
 
Beginner's guide to git
Beginner's guide to gitBeginner's guide to git
Beginner's guide to git
 
Advanted git
Advanted git Advanted git
Advanted git
 
Git: Git'ing the Basic
Git: Git'ing the BasicGit: Git'ing the Basic
Git: Git'ing the Basic
 
GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17GIT_GITHUB_2016_06_17
GIT_GITHUB_2016_06_17
 
Hyperscale SIG Introduction
Hyperscale SIG IntroductionHyperscale SIG Introduction
Hyperscale SIG Introduction
 
Git advanced
Git advancedGit advanced
Git advanced
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 

Similar to Crash course in git and github

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Amit Mathur
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
Sreedath N S
 
Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptx
gdscuds
 
Brown bag sessions git workshop
Brown bag sessions git workshopBrown bag sessions git workshop
Brown bag sessions git workshop
Bishant Shrestha
 
Git
GitGit
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
Cory Webb
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
Ashok Kumar
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
introduction in version control system
introduction in version control systemintroduction in version control system
introduction in version control system
Biga Gaber
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
Docker, Inc.
 
14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx
GDSCGHRIETNagpur
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control System
Md. Mujahid Islam
 
Getting started & Hosting your website on GitHub
Getting started & Hosting your website on GitHubGetting started & Hosting your website on GitHub
Getting started & Hosting your website on GitHubKartik Kannapur
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
lanhuonga3
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
Supachai Vorrasing
 

Similar to Crash course in git and github (20)

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Introduction to Git.pptx
Introduction to Git.pptxIntroduction to Git.pptx
Introduction to Git.pptx
 
Brown bag sessions git workshop
Brown bag sessions git workshopBrown bag sessions git workshop
Brown bag sessions git workshop
 
Git
GitGit
Git
 
Git & G
Git & GGit & G
Git & G
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git & GitHub
Git & GitHubGit & GitHub
Git & GitHub
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
introduction in version control system
introduction in version control systemintroduction in version control system
introduction in version control system
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx14 oct Git & GitHub.pptx
14 oct Git & GitHub.pptx
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Presentation on Repository Control System
Presentation on Repository Control SystemPresentation on Repository Control System
Presentation on Repository Control System
 
Getting started & Hosting your website on GitHub
Getting started & Hosting your website on GitHubGetting started & Hosting your website on GitHub
Getting started & Hosting your website on GitHub
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
Git: Why And How to
Git: Why And How toGit: Why And How to
Git: Why And How to
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
 

More from Mithun Shanbhag

CloudSkew Architecture
CloudSkew ArchitectureCloudSkew Architecture
CloudSkew Architecture
Mithun Shanbhag
 
Azure Pipelines
Azure PipelinesAzure Pipelines
Azure Pipelines
Mithun Shanbhag
 
Terraform on Azure
Terraform on AzureTerraform on Azure
Terraform on Azure
Mithun Shanbhag
 
Identity, authentication and authorization
Identity, authentication and authorizationIdentity, authentication and authorization
Identity, authentication and authorization
Mithun Shanbhag
 
Design Patterns for Data Management and Consistency
Design Patterns for Data Management and ConsistencyDesign Patterns for Data Management and Consistency
Design Patterns for Data Management and Consistency
Mithun Shanbhag
 
WSL - Windows SubSytem For Linux
WSL - Windows SubSytem For LinuxWSL - Windows SubSytem For Linux
WSL - Windows SubSytem For Linux
Mithun Shanbhag
 
Creating user-mode debuggers for Windows
Creating user-mode debuggers for WindowsCreating user-mode debuggers for Windows
Creating user-mode debuggers for Windows
Mithun Shanbhag
 
Crash course in sql
Crash course in sqlCrash course in sql
Crash course in sql
Mithun Shanbhag
 

More from Mithun Shanbhag (8)

CloudSkew Architecture
CloudSkew ArchitectureCloudSkew Architecture
CloudSkew Architecture
 
Azure Pipelines
Azure PipelinesAzure Pipelines
Azure Pipelines
 
Terraform on Azure
Terraform on AzureTerraform on Azure
Terraform on Azure
 
Identity, authentication and authorization
Identity, authentication and authorizationIdentity, authentication and authorization
Identity, authentication and authorization
 
Design Patterns for Data Management and Consistency
Design Patterns for Data Management and ConsistencyDesign Patterns for Data Management and Consistency
Design Patterns for Data Management and Consistency
 
WSL - Windows SubSytem For Linux
WSL - Windows SubSytem For LinuxWSL - Windows SubSytem For Linux
WSL - Windows SubSytem For Linux
 
Creating user-mode debuggers for Windows
Creating user-mode debuggers for WindowsCreating user-mode debuggers for Windows
Creating user-mode debuggers for Windows
 
Crash course in sql
Crash course in sqlCrash course in sql
Crash course in sql
 

Recently uploaded

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
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
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
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
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
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
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 

Recently uploaded (20)

Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
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
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
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
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
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
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 

Crash course in git and github

  • 1. Crash course in Git and Github www.skewcode.com
  • 2. Table of Contents ● DVCS ● Git - Installation ● Git - Basic concepts ● Git - Branches ● Git - Remotes ● Git - Remote tracking branches ● Git - Merging ● References
  • 3. Distributed version control system v2 CENTRAL REPOSITORY VERSION HISTORY v1 v3 v2v1 v3 CENTRAL REPOSITORY VERSION HISTORY v2v1 v3 COMPUTER A VERSION HISTORY v2v1 v3 COMPUTER B VERSION HISTORY DVCS COMPUTER A COMPUTER B VCS FILE 1 FILE 2 FILE 4 FILE 5
  • 4. Git - Installation Installation ○ https://git-scm.com/ ○ sudo apt-get install git-all ○ brew install git Configuration ○ git config --global user.name "Rahul Sharma" ○ git config --global user.email rahulsharma@gmail.com ○ git config --global color.ui auto ○ git config --global core.editor "code --wait" ○ git config --list
  • 5. Git - Installation Creating a new local repository ● mkdir mysourcerepo ● cd mysourcerepo ● git init Cloning an existing remote repository ● mkdir mysourcerepo ● git clone https://github.com/skewcode/101-github.git mysourcerepo
  • 6. Git - Basic Concepts working directory staging area (index)Local repository / commits (.git folder) git add git commit X1 X1X1 git diff git diff --staged Remote repository / commits (github) X1 git push git status git fetch or git pull
  • 7. Git - Basic Concepts working directory staging area (index)Local repository / commits (.git folder) git add git commit X1 X1X2X1 X2 X2 git log
  • 8. Git - Remotes Local repository Remote repository (github) git remote -v https://github.com/skewcode/101-gitdemo.git
  • 9. Git - Branches working directory staging area (index)Local repository (commits) git add git commit X1 X1X2X1 X2 X2 mastermaster X3 X3X3 master
  • 10. Git - Branches working directory staging area (index)Local repository (commits) git add git commit X1 X1X2X1 X2 X2 mastermaster X3 X3 X3 devbranch devbranch git branch devbranch git checkout devbranch X4 master git checkout master X4 X4
  • 11. Git - Remote tracking branches Local repository X2X1 X3 master X2 X3X1 mastermastermaster origin/master Remote repository git fetch origin X4 master X5 master X4 origin/master git branch -vv
  • 12. Git - Merging (fast-forward) working directory staging area (index)Local repository (commits) git add git commit X1 X1X2X1 X2 X2 mastermaster X3 X3X3 devbranch devbranch git branch devbranch git checkout devbranch master git checkout master git merge devbranch
  • 13. Git - Merging (three-way) working directory staging area (index)Local repository (commits) git add git commit X1 X1X2X1 X2 X2 mastermaster X3 X3 X3 devbranch devbranch git branch devbranch git checkout devbranch X4 master git checkout master X4 X4 git merge devbranch X5 master

Editor's Notes

  1. What is version control? VCS vs DVCS
  2. 1: Install vscode. The vscode executable “code” will automatically be added to PATH on windows, linux. 2: [For mac only] CMD + P, >Shell Command: Install ‘code’ in PATH
  3. 1: A ‘commit’ is a snapshot of the ‘index’.
  4. Git clone automatically sets up the remote “origin”
  5. Why branching is needed? Branch is a pointer to latest commit. HEAD
  6. Git clone automatically sets up both the remote “origin” and the remote-tracking branch. Remote-tracking branches act as bookmarks to remind you where the branches in your remote repositories were the last time you connected to them. To synchronize, run git fetch To create remote-tracking branch: git clone Format of remote-tracking branch: remote / branch To fetch a remote branch: git fetch (note: read-only copy of branch) To create a local, editable copy: git merge or git checkout -b [branch] remote/branch Git checkout [branch] (will be created if doesn’t exist + remote branch name exists) Set upstream for existing branch