SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
- 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

Contenu connexe

Tendances (20)

Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
git and github
git and githubgit and github
git and github
 
Git & GitHub WorkShop
Git & GitHub WorkShopGit & GitHub WorkShop
Git & GitHub WorkShop
 
Git basics
Git basicsGit basics
Git basics
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Starting with Git & GitHub
Starting with Git & GitHubStarting with Git & GitHub
Starting with Git & GitHub
 
Github basics
Github basicsGithub basics
Github basics
 
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
 
Git basic
Git basicGit basic
Git basic
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git advanced
Git advancedGit advanced
Git advanced
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 

En vedette

Machine learning – 101
Machine learning – 101Machine learning – 101
Machine learning – 101Behzad Altaf
 
Message Oriented Middleware
Message Oriented MiddlewareMessage Oriented Middleware
Message Oriented MiddlewareBehzad 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 NicheLeslie 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
 
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 Genovamperrando
 
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/15Giovanni Buffa
 
Git基礎介紹
Git基礎介紹Git基礎介紹
Git基礎介紹Max Ma
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshellNelson Tai
 

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

Similaire à 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 UnityRifauddin 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 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 GitGeoff 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 basicsChris Bohatka
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptuallyseungzzang Kim
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Gitatishgoswami
 
Learning Basic GIT Cmd
Learning Basic GIT CmdLearning Basic GIT Cmd
Learning Basic GIT Cmdsrinathcox
 
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 and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with GitThings Lab
 

Similaire à 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
 

Dernier

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%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 midrandmasabamasaba
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
%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 kaalfonteinmasabamasaba
 

Dernier (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%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
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%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
 

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