SlideShare a Scribd company logo
- Behzad Altaf
A 2-3-5-7-11-13…-r
Agenda
• Version Control
• What
• Why
• Types
• How
• Git
• History
• Fundamentals
• Basic Commands
• Branching
• Working with remote
• Further reading/ references
• Tips
Version Control
• In computer software engineering, revision control is any kind of practice
that tracks and provides control over changes to source code.
• Version control is a system that records changes to a file or set of files over
time so that you can recall specific versions later.
https://en.wikipedia.org/wiki/Version_control
Version Control – Why?
Version Control – Why?
http://www.webdesignerdepot.com/2009/03/intro-to-git-for-web-designers/
Version Control – Why?
Version Control - Local
https://git-scm.com/book/en/v2
Version Control - Centralized
https://git-scm.com/book/en/v2
Version Control - Distributed
https://git-scm.com/book/en/v2
Version Control - options
What is git?
Distributed Performant Reliable
Git – History
• The Linux kernel is an open source software project of fairly large scope. For most of the lifetime of the
Linux kernel maintenance (1991–2002), changes to the software were passed around as patches and
archived files. In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper.
• In 2005, the relationship between the community that developed the Linux kernel and the commercial
company that developed BitKeeper broke down, and the tool’s free-of-charge status was revoked. This
prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to
develop their own tool based on some of the lessons they learned while using BitKeeper.
https://git-scm.com/book/en/v2
Git - Data Storage
Storing data as changes to a base version of each file.
Storing data as snapshots of the project over time.
https://git-scm.com/book/en/v2
Git - The Sections
https://git-scm.com/book/en/v2
Git - The Sections
http://www.slideshare.net/nullstein/git-usage-patterns
https://git-scm.com/book/en/v2
Git - File Lifecycle
GIT Installation
git for Windows
https://git-for-windows.github.io/
https://git-scm.com/book/en/v2
Git - Commands
CLONE – an existing repository
Git – Basic Commands
Checking status of files
$ Git status
Output On branch master nothing to commit, working directory clean
Checking status of files – Untracked files – (Add a file to working dir.)
$ Git status
Output
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
New Text Document.txt
nothing added to commit but untracked files present (use "git add" to track)
Tracking files – Add
$ git add <filename>
Output On branch master nothing to commit, working directory clean
Checking status of files – After adding file
$ git status
Output
On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage)
new file: <File Name>
Staging Modified Files (Modify a file)
If you change a previously tracked file called “CONTRIBUTING.md” and then run
your git status command again, you get something that looks like this:
$ git status
Output
Changes not staged for commit: (use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory
You have to add them again
$ git add CONTRIBUTING.md
Git – Basic Commands
Git – Basic Commands
Commit files
$ git commit
$ git commit –m
Skipping the staging area
$ git commit -a –m [applicable for tracked files]
Removing File- You have to remove it from tracked files(staging area) and then commit
$ git rm <<File name>>
$ git commit
Commit History -
$ git logs
Unstaging staged file
$ git reset HEAD CONTRIBUTING.md
Unmodifying a Modified File
$ git checkout -- CONTRIBUTING.md
Git - Branching
Git - Merging
Git – Working with remote
$ git remote –v
$ git remote add origin (remote name) http://github.com/somrepo.git
$ git pull origin (remote) master (branch) {git fetch and merge}
$ git push origin (remote) master (branch)
Git - Ignoring files
.gitignore
Git - On the server
Git - IDE Plugins
Git – Online Exercises
• http://pcottle.github.io/learngitBranching/
• https://try.github.io/levels/1/challenges/1
• https://www.codeschool.com/courses/git-real
Git - Further Reading
• PRO GIT (Beginner)
https://git-scm.com/book/en/v2
• Git Pocket Guide (Advanced)
http://www.amazon.in/Git-Pocket-Guide-Richard-Silverman/dp/935110236X
Git - Always Remember – git never forgets!
There are a lot of great things about Git, but one feature that can cause issues is the fact that a git clone
downloads the entire history of the project, including every version of every file.
This is fine if the whole thing is source code, because Git is highly optimized to compress that data
efficiently.
However, if someone at any point in the history of your project added a single huge file, every clone for all
time will be forced to download that large file, even if it was removed from the project in the very next
commit. Because it’s reachable from the history, it will always be there.
https://rtyley.github.io/bfg-repo-cleaner/
https://git-scm.com/book/en/v2

More Related Content

What's hot

Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
SheilaJimenezMorejon
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
Paulo Henrique Nonaka
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
Poornachandrakashi
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
Safique Ahmed Faruque
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
KMS Technology
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
GoogleDeveloperStude4
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Md Swawibe Ul Alam
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
Gaurav Wable
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
Jiwon Baek
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Rueful Robin
 
git and github
git and githubgit and github
git and github
Darren Oakley
 

What's hot (20)

Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Introduction to git & GitHub
Introduction to git & GitHubIntroduction to git & GitHub
Introduction to git & GitHub
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overviewGit and GitHub | Concept about Git and GitHub Process | Git Process overview
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
 
git and github
git and githubgit and github
git and github
 

Viewers also liked

Machine learning – 101
Machine learning – 101Machine learning – 101
Machine learning – 101
Behzad Altaf
 
Message Oriented Middleware
Message Oriented MiddlewareMessage Oriented Middleware
Message Oriented Middleware
Behzad Altaf
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
Perchè Git?
Perchè Git?Perchè Git?
Perchè Git?
Mauro Ferratello
 
Git–SVN
Git–SVNGit–SVN
Sys05 uso consapevole di git - beyond the basic
Sys05   uso consapevole di git - beyond the basicSys05   uso consapevole di git - beyond the basic
Sys05 uso consapevole di git - beyond the basicDotNetCampus
 
Linux Day 2015 Genova
Linux Day 2015 GenovaLinux Day 2015 Genova
Linux Day 2015 Genova
mperrando
 
GITT (part 1 of 2)
GITT (part 1 of 2)GITT (part 1 of 2)
GITT (part 1 of 2)
Ali Servet Donmez
 
Introduzione a GIT - Laboratorio di Web Design 2014/15
Introduzione a GIT - Laboratorio di Web Design 2014/15Introduzione a GIT - Laboratorio di Web Design 2014/15
Introduzione a GIT - Laboratorio di Web Design 2014/15
Giovanni Buffa
 
Introduzione a git
Introduzione a gitIntroduzione a git
Introduzione a git
Marco Santonocito
 
Git best practices
Git best practicesGit best practices
Git best practices
Matteo Gavagnin
 
Introduzione a Git
Introduzione a GitIntroduzione a Git
Introduzione a Git
Stefano Valle
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
Cristian Lucchesi
 
Anatomia di un progetto open-source
Anatomia di un progetto open-sourceAnatomia di un progetto open-source
Anatomia di un progetto open-source
Bergamo Linux Users Group
 
Controllo di versione e Git
Controllo di versione e GitControllo di versione e Git
Controllo di versione e Git
Marcello Missiroli
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹
Max Ma
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
Nelson Tai
 

Viewers also liked (20)

Machine learning – 101
Machine learning – 101Machine learning – 101
Machine learning – 101
 
Message Oriented Middleware
Message Oriented MiddlewareMessage Oriented Middleware
Message Oriented Middleware
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Perchè Git?
Perchè Git?Perchè Git?
Perchè Git?
 
Git–SVN
Git–SVNGit–SVN
Git–SVN
 
Sys05 uso consapevole di git - beyond the basic
Sys05   uso consapevole di git - beyond the basicSys05   uso consapevole di git - beyond the basic
Sys05 uso consapevole di git - beyond the basic
 
Linux Day 2015 Genova
Linux Day 2015 GenovaLinux Day 2015 Genova
Linux Day 2015 Genova
 
GITT (part 1 of 2)
GITT (part 1 of 2)GITT (part 1 of 2)
GITT (part 1 of 2)
 
Introduzione a GIT - Laboratorio di Web Design 2014/15
Introduzione a GIT - Laboratorio di Web Design 2014/15Introduzione a GIT - Laboratorio di Web Design 2014/15
Introduzione a GIT - Laboratorio di Web Design 2014/15
 
GitSlides
GitSlidesGitSlides
GitSlides
 
Introduzione a git
Introduzione a gitIntroduzione a git
Introduzione a git
 
Git best practices
Git best practicesGit best practices
Git best practices
 
Introduzione a Git
Introduzione a GitIntroduzione a Git
Introduzione a Git
 
Git e Git Flow
Git e Git Flow Git e Git Flow
Git e Git Flow
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Anatomia di un progetto open-source
Anatomia di un progetto open-sourceAnatomia di un progetto open-source
Anatomia di un progetto open-source
 
Controllo di versione e Git
Controllo di versione e GitControllo di versione e Git
Controllo di versione e Git
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 

Similar to Git - An Introduction

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
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
Rifauddin Tsalitsy
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
Max Claus Nunes
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
Supachai Vorrasing
 
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
Git basics
Git basicsGit basics
Git basics
Malihe Asemani
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
Serhii Kartashov
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
Chris Bohatka
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
seungzzang Kim
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
atishgoswami
 
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
srinathcox
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Brian K. Vagnini
 
Git
GitGit
Git: be social
Git: be socialGit: be social
Git: be social
Geronimo Orozco
 
Git
GitGit
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
gdsc13
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with GitThings Lab
 

Similar to Git - An Introduction (20)

Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
GIT from n00b
GIT from n00bGIT from n00b
GIT from n00b
 
Git introduction
Git introductionGit introduction
Git introduction
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Git basics
Git basicsGit basics
Git basics
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmd
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 
Git
GitGit
Git
 
Git: be social
Git: be socialGit: be social
Git: be social
 
Git
GitGit
Git
 
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
 

Recently uploaded

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
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
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
MayankTawar1
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
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
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
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
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 

Recently uploaded (20)

Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.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
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
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 ...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
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...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 

Git - An Introduction

  • 1. - Behzad Altaf A 2-3-5-7-11-13…-r
  • 2. Agenda • Version Control • What • Why • Types • How • Git • History • Fundamentals • Basic Commands • Branching • Working with remote • Further reading/ references • Tips
  • 3.
  • 4. Version Control • In computer software engineering, revision control is any kind of practice that tracks and provides control over changes to source code. • Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later. https://en.wikipedia.org/wiki/Version_control
  • 6. Version Control – Why? http://www.webdesignerdepot.com/2009/03/intro-to-git-for-web-designers/
  • 8. Version Control - Local https://git-scm.com/book/en/v2
  • 9. Version Control - Centralized https://git-scm.com/book/en/v2
  • 10. Version Control - Distributed https://git-scm.com/book/en/v2
  • 11. Version Control - options
  • 12.
  • 13. What is git? Distributed Performant Reliable
  • 14. Git – History • The Linux kernel is an open source software project of fairly large scope. For most of the lifetime of the Linux kernel maintenance (1991–2002), changes to the software were passed around as patches and archived files. In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper. • In 2005, the relationship between the community that developed the Linux kernel and the commercial company that developed BitKeeper broke down, and the tool’s free-of-charge status was revoked. This prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to develop their own tool based on some of the lessons they learned while using BitKeeper. https://git-scm.com/book/en/v2
  • 15. Git - Data Storage Storing data as changes to a base version of each file. Storing data as snapshots of the project over time. https://git-scm.com/book/en/v2
  • 16. Git - The Sections https://git-scm.com/book/en/v2
  • 17. Git - The Sections http://www.slideshare.net/nullstein/git-usage-patterns
  • 19. GIT Installation git for Windows https://git-for-windows.github.io/ https://git-scm.com/book/en/v2
  • 20. Git - Commands CLONE – an existing repository
  • 21. Git – Basic Commands Checking status of files $ Git status Output On branch master nothing to commit, working directory clean Checking status of files – Untracked files – (Add a file to working dir.) $ Git status Output Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) New Text Document.txt nothing added to commit but untracked files present (use "git add" to track)
  • 22. Tracking files – Add $ git add <filename> Output On branch master nothing to commit, working directory clean Checking status of files – After adding file $ git status Output On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: <File Name> Staging Modified Files (Modify a file) If you change a previously tracked file called “CONTRIBUTING.md” and then run your git status command again, you get something that looks like this: $ git status Output Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory You have to add them again $ git add CONTRIBUTING.md Git – Basic Commands
  • 23. Git – Basic Commands Commit files $ git commit $ git commit –m Skipping the staging area $ git commit -a –m [applicable for tracked files] Removing File- You have to remove it from tracked files(staging area) and then commit $ git rm <<File name>> $ git commit Commit History - $ git logs Unstaging staged file $ git reset HEAD CONTRIBUTING.md Unmodifying a Modified File $ git checkout -- CONTRIBUTING.md
  • 26. Git – Working with remote $ git remote –v $ git remote add origin (remote name) http://github.com/somrepo.git $ git pull origin (remote) master (branch) {git fetch and merge} $ git push origin (remote) master (branch)
  • 27. Git - Ignoring files .gitignore
  • 28. Git - On the server
  • 29. Git - IDE Plugins
  • 30. Git – Online Exercises • http://pcottle.github.io/learngitBranching/ • https://try.github.io/levels/1/challenges/1 • https://www.codeschool.com/courses/git-real
  • 31. Git - Further Reading • PRO GIT (Beginner) https://git-scm.com/book/en/v2 • Git Pocket Guide (Advanced) http://www.amazon.in/Git-Pocket-Guide-Richard-Silverman/dp/935110236X
  • 32. Git - Always Remember – git never forgets! There are a lot of great things about Git, but one feature that can cause issues is the fact that a git clone downloads the entire history of the project, including every version of every file. This is fine if the whole thing is source code, because Git is highly optimized to compress that data efficiently. However, if someone at any point in the history of your project added a single huge file, every clone for all time will be forced to download that large file, even if it was removed from the project in the very next commit. Because it’s reachable from the history, it will always be there. https://rtyley.github.io/bfg-repo-cleaner/ https://git-scm.com/book/en/v2