SlideShare a Scribd company logo
1 of 33
Download to read offline
Git-r-done
An Introduction into Git Version Control
First things first, what is Git?
Git is a version control system. It
tracks a file or set of files and
records changes. These can later
be reverted to a previous version.
Why should we care?
• Reversibility
• Concurrence
• History
Distributed vs. Centralized
There are other
options…
So, why Git?
• Fast
• Handle huge projects with ease
• Simple
• Fully Distributed
• Open Source (FREEEEEEE)
Installation
Let’s get down and dirty.
• Mac: brew install git or http://code.google.com/
p/git-osx-installer
• Linux: apt-get install git
• Windows: http://msysgit.github.com/
It’s a good idea to go ahead and:
!
git config —global user.name “Yo’Name”
git config —global user.email “Yo’Email”
Let’s git it going…
(go ahead… laugh)
There are two basic ways
to create a Git repository
Existing project
• cd into/project/folder
• git init
• This will create a git repository for your project
• At this point, files are not being tracked.
Clone a repo
• cd into/desired/folder
• git clone <url>
• The url here will will default to the origin of the
remote.
• Clean repo, all files that have been added are
being tracked.
Git works in three
basic states
Committed
Data is safely stored in the git repository
Modified
Data has been modified but it is yet to be committed.
Staged
Data has been marked to be committed
Git workflow
The Bread and Butter
• git status; check the status of the working
directory
• git add <options> <filename>; track/stage files
to be committed.
• git commit; Commit a git snapshot into a
repository.
Before we get ahead of
ourselves… most of the time, it’s a
good idea to initialize a .gitignore
.gitignore
• Control which files will be ignored when staging
• Add files that you want to ignore to this list
• *.x <— Ignores all files ending in .x
• For directories, end in ‘/’
• Basic bash patterns can be used.
Branches and
Merging
Branches
• git branch <name>; create a new branch
• git checkout <name>; switch HEAD to a branch
• git checkout -b <name>; create a branch and
switch to it.
• git branch; show a list of all the branches.
Merging
• git checkout master; first change into master
branch
• git merge <name-of-branch>; merge branch
with master branch
Hosting Services
If git init
• git remote add <name> <url>
• git push -u <remote> <branch>
Otherwise
• git pull
• git push
That’s basically it
Questions?

More Related Content

What's hot

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitColin Su
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with GitRick Umali
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails UndergroundAriejan de Vroom
 
Git: basic to advanced
Git: basic to advancedGit: basic to advanced
Git: basic to advancedYodalee
 
Getting Started on distributed version control with git
Getting Started on distributed version control with gitGetting Started on distributed version control with git
Getting Started on distributed version control with gitAnoop Thomas Mathew
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practiceMajid Hosseini
 
Git tutorial
Git tutorialGit tutorial
Git tutorialmobaires
 
Git hub abduallah abu nada
Git hub   abduallah abu nadaGit hub   abduallah abu nada
Git hub abduallah abu nadaLama K Banna
 
Git Introduction
Git IntroductionGit Introduction
Git IntroductionGareth Hall
 
Basic principles of Git
Basic principles of GitBasic principles of Git
Basic principles of Gitphuongvohuy
 

What's hot (20)

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Getting Started with Git
Getting Started with GitGetting Started with Git
Getting Started with Git
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
 
Git: basic to advanced
Git: basic to advancedGit: basic to advanced
Git: basic to advanced
 
Getting Started on distributed version control with git
Getting Started on distributed version control with gitGetting Started on distributed version control with git
Getting Started on distributed version control with git
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git & Github
Git & GithubGit & Github
Git & Github
 
Git & github
Git & githubGit & github
Git & github
 
Git basics : a beginner's guide
Git basics : a beginner's guideGit basics : a beginner's guide
Git basics : a beginner's guide
 
Git undo
Git undoGit undo
Git undo
 
Git Tricks
Git TricksGit Tricks
Git Tricks
 
Git hub abduallah abu nada
Git hub   abduallah abu nadaGit hub   abduallah abu nada
Git hub abduallah abu nada
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Git github
Git githubGit github
Git github
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
Basic principles of Git
Basic principles of GitBasic principles of Git
Basic principles of Git
 

Viewers also liked (14)

Stephanycampohernandez
StephanycampohernandezStephanycampohernandez
Stephanycampohernandez
 
Web 2
Web 2Web 2
Web 2
 
Protección Animal
Protección AnimalProtección Animal
Protección Animal
 
Nota_prensa_inicioactividades_gl
Nota_prensa_inicioactividades_glNota_prensa_inicioactividades_gl
Nota_prensa_inicioactividades_gl
 
Krisna Dimas Priambodo
Krisna Dimas PriambodoKrisna Dimas Priambodo
Krisna Dimas Priambodo
 
Full throttle intermedia
Full throttle intermediaFull throttle intermedia
Full throttle intermedia
 
Currículum
CurrículumCurrículum
Currículum
 
Maria teresa
Maria teresaMaria teresa
Maria teresa
 
NEW CV
NEW CVNEW CV
NEW CV
 
Letter of Recommendation Ricardo BD
Letter of Recommendation Ricardo BDLetter of Recommendation Ricardo BD
Letter of Recommendation Ricardo BD
 
Selective Attention Research
Selective Attention ResearchSelective Attention Research
Selective Attention Research
 
Concrete Repair Presentation Current
Concrete Repair  Presentation CurrentConcrete Repair  Presentation Current
Concrete Repair Presentation Current
 
Papercrete
PapercretePapercrete
Papercrete
 
аксесуар
аксесуараксесуар
аксесуар
 

Similar to Git-r-done: An Intro to Git Version Control

The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubKim Moir
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Git Introductive
Git IntroductiveGit Introductive
Git IntroductiveAdham Saad
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hubVenkat Malladi
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptxtnscharishma
 
Git with the flow
Git with the flowGit with the flow
Git with the flowDana White
 

Similar to Git-r-done: An Intro to Git Version Control (20)

Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
 
Git training v10
Git training v10Git training v10
Git training v10
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Talk to git
Talk to gitTalk to git
Talk to git
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
Git workshop
Git workshopGit workshop
Git workshop
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git presentation
Git presentationGit presentation
Git presentation
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptx
 
Git with the flow
Git with the flowGit with the flow
Git with the flow
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Git-r-done: An Intro to Git Version Control