SlideShare a Scribd company logo
1 of 37
Git
-Akshay
Overview
1. Install git and create a Github account
2.
3.
4.
5.
What is git?
How does git work?
What is GitHub?
Quick example using git and GitHub
Github icon
1 Install git and a create GitHub
account
Install git
• Linux (Debian)
- Command: sudo apt-get install git
• Linux (Fedora)
- Command: sudo yum install git
• Mac
- http://git-scm.com/download/mac
• Windows
- http://git-scm.com/download/win
Create Github account
•
•
www.github.com
Free for public repositories
What is version control?
• Asystem that keeps records of
your changes
Allows for collaborative
development
Allows you to know who
what changes and when
•
• made
• Allows you to revert any changes
and go back to a previous state
2 What is git?
What is version control?
• Distributed version control
Users keep entire code and•
history on their location
machines
• Users can make any changes
without internet access
• (Except pushing and pulling
changes from a remote server)
What is git?
•
•
Started in 2005
Created by Linus Torvald to aid
in Linuxkernel development
Git icon
What is git?
• Git isn’t
system
the only version control
• But (we think) it’s the best
3 How does git work?
How does git work?
• Can be complicated at first, but
there are a few key concepts
Important git terminology in
following :
•
Key Concepts:Snapshots
• The way git keeps track of your
history
code
• Essentially records what all your files
look like at a given point in time
You decide when to take a snapshot,
and of what files
Have the ability to go back to visit any
snapshot
Your snapshots from later on will stay
around, too
•
•
•
Key Concepts: Commit
•
•
The act of creating a snapshot
Can be a noun or verb
“I commited code”
“I just made a new commit”
•
•
• Essentially, a project is made
of a bunch of commits
up
Key Concepts: Commit
• Commits contain three pieces of
information:
1. Information about how the files
changed from previously
Areference to the commit
came before it
Called the “parent commit”
Ahash code name
2. that
•
3.
• Will look something like:
fb2d2ec5069fc6776c80b3ad6b7cbde3cade4e
Key Concepts: Repositories
•
•
Often shortened to ‘repo’
Acollection of all the files
the history of those files
• Consists of all your commits
and
• Place where all your hard work is
stored
Key Concepts: Repositories
• Can live on a local machine or
on a remote server (GitHub!)
The act of copying a repository
from a remote server is called
cloning
Cloning from a remote server
allows teams to work together
•
•
Key Concepts: Repositories
• The process of downloading
commits that don’t exist on your
machine from a remote repository
is called pulling changes
The process of adding your local
changes to the remote repository
is called pushing changes
•
Key Concepts: Branches
• All commits in git live on some
branch
• But there
branches
The main
can be many, many
• branch in a project is
called the master branch
So, what does a typical project look like?
• Abunch of commits linked
together that live on some branch,
contained in a repository
So, what does a typical project look like?
Time going forward
So, what is HEAD?
Time going forward
So, what is HEAD?
• Areference
commit
to the most recent
Time going forward
So, what is HEAD?
• Areference to the
commit
most recent
• (in most cases – not always true!)
Time going forward
So, what is
MASTER?
•
•
The main branch in your project
Doesn’t have to be called master, but almost
always is!
Time going forward
Key Concepts: Branching off of the master
branch
• The start of a branch points to
specific commit
When you want to make any
changes to your project you
make a new branch based on
commit
a
•
a
Key Concepts:
branch
Branching off of the master
Time going forward
aster
Key Concepts: Merging
• Once you’re done with your
feature, you merge it back into
Time going forward
Key Concepts: How do you make a commit
anyway?
• There are a lot of ‘states’ and ‘places’
a file can be
Local on your computer: the ‘working
directory’
When a file is ready to be put in a
commit you add it onto the ‘index’ or
‘staging’
•
•
• Staging is the new preferred term – but
you can see both ‘index’and ‘staging’
being used
Key Concepts: How do you make
anyway?
a commit
• The process:
•
•
Make some changes to a file
Use the ‘git add’ command to put
the file onto the staging
environment
Use the ‘git commit’ command to
create a new commit’
•
Key Concepts:
anyway?
How do you make a commit
Time going forward
Key Concepts:
anyway?
How do you make a commit
Time going forward
4 What is GitHub?
What is GitHub?
• www.github.com
• Largest web-based
hosting service
git repository
• Aka, hosts ‘remote repositories’
• Allows for code collaboration with
anyone online
Adds extra functionality on top of git•
• UI, documentation, bug tracking, feature
requests, pull requests, and more!
Octocat!
What is GitHub?
•
•
Founded in 2008
Also has an Enterprise
for businesses
edition
Octocat!
Additional Resources
Additional Resources
• Official git site and tutorial:
https://git-scm.com/
GitHub guides:
https://guides.github.com/
Command cheatsheet:
https://training.github.com/kit/
downloads/github-git-cheat-sheet.pdf
Interactive git tutorial:
https://try.github.io/levels/1/challenges/1
Visual/interactive cheatsheet:
http://ndpsoftware.com/git-cheatsheet.html
•
•
•
•

More Related Content

What's hot

What's hot (20)

Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
 
Teaching a Designer to Use GitHub
Teaching a Designer to Use GitHubTeaching a Designer to Use GitHub
Teaching a Designer to Use GitHub
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Git 101
Git 101Git 101
Git 101
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git101
Git101Git101
Git101
 
An Introduction to Git
An Introduction to GitAn Introduction to Git
An Introduction to Git
 
Gitgithub101slideshare 150922131830-lva1-app6891
Gitgithub101slideshare 150922131830-lva1-app6891Gitgithub101slideshare 150922131830-lva1-app6891
Gitgithub101slideshare 150922131830-lva1-app6891
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
 
Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash course
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
GitHub Basics - Derek Bable
GitHub Basics - Derek BableGitHub Basics - Derek Bable
GitHub Basics - Derek Bable
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
 
Github
GithubGithub
Github
 
Git tutorial II
Git tutorial IIGit tutorial II
Git tutorial II
 

Similar to Git and Github

Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
Things Lab
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
Adham Saad
 

Similar to Git and Github (20)

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
 
Git and github
Git and githubGit and github
Git and github
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Demo
DemoDemo
Demo
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
O365Con18 - Git and GitHub - Rick van Rousselt
O365Con18 - Git and GitHub - Rick van RousseltO365Con18 - Git and GitHub - Rick van Rousselt
O365Con18 - Git and GitHub - Rick van Rousselt
 
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
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git
GitGit
Git
 
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
 
Quick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHubQuick and easy way to get started with Git & GitHub
Quick and easy way to get started with Git & GitHub
 
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
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Source Code Management with Git
Source Code Management with GitSource Code Management with Git
Source Code Management with Git
 
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 Introductive
Git IntroductiveGit Introductive
Git Introductive
 

More from Akshay Vasava (7)

Moodle - E Learning
Moodle - E LearningMoodle - E Learning
Moodle - E Learning
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
WHONIX OS
WHONIX OSWHONIX OS
WHONIX OS
 
Touchless Touchscreen Technology
Touchless Touchscreen TechnologyTouchless Touchscreen Technology
Touchless Touchscreen Technology
 
N3XT
N3XTN3XT
N3XT
 
Mymanet
MymanetMymanet
Mymanet
 
3 D Internet
3 D Internet3 D Internet
3 D Internet
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Git and Github

  • 2. Overview 1. Install git and create a Github account 2. 3. 4. 5. What is git? How does git work? What is GitHub? Quick example using git and GitHub Github icon
  • 3. 1 Install git and a create GitHub account
  • 4. Install git • Linux (Debian) - Command: sudo apt-get install git • Linux (Fedora) - Command: sudo yum install git • Mac - http://git-scm.com/download/mac • Windows - http://git-scm.com/download/win
  • 6. What is version control? • Asystem that keeps records of your changes Allows for collaborative development Allows you to know who what changes and when • • made • Allows you to revert any changes and go back to a previous state
  • 7. 2 What is git?
  • 8. What is version control? • Distributed version control Users keep entire code and• history on their location machines • Users can make any changes without internet access • (Except pushing and pulling changes from a remote server)
  • 9. What is git? • • Started in 2005 Created by Linus Torvald to aid in Linuxkernel development Git icon
  • 10. What is git? • Git isn’t system the only version control • But (we think) it’s the best
  • 11. 3 How does git work?
  • 12. How does git work? • Can be complicated at first, but there are a few key concepts Important git terminology in following : •
  • 13. Key Concepts:Snapshots • The way git keeps track of your history code • Essentially records what all your files look like at a given point in time You decide when to take a snapshot, and of what files Have the ability to go back to visit any snapshot Your snapshots from later on will stay around, too • • •
  • 14. Key Concepts: Commit • • The act of creating a snapshot Can be a noun or verb “I commited code” “I just made a new commit” • • • Essentially, a project is made of a bunch of commits up
  • 15. Key Concepts: Commit • Commits contain three pieces of information: 1. Information about how the files changed from previously Areference to the commit came before it Called the “parent commit” Ahash code name 2. that • 3. • Will look something like: fb2d2ec5069fc6776c80b3ad6b7cbde3cade4e
  • 16. Key Concepts: Repositories • • Often shortened to ‘repo’ Acollection of all the files the history of those files • Consists of all your commits and • Place where all your hard work is stored
  • 17. Key Concepts: Repositories • Can live on a local machine or on a remote server (GitHub!) The act of copying a repository from a remote server is called cloning Cloning from a remote server allows teams to work together • •
  • 18. Key Concepts: Repositories • The process of downloading commits that don’t exist on your machine from a remote repository is called pulling changes The process of adding your local changes to the remote repository is called pushing changes •
  • 19. Key Concepts: Branches • All commits in git live on some branch • But there branches The main can be many, many • branch in a project is called the master branch
  • 20. So, what does a typical project look like? • Abunch of commits linked together that live on some branch, contained in a repository
  • 21. So, what does a typical project look like? Time going forward
  • 22. So, what is HEAD? Time going forward
  • 23. So, what is HEAD? • Areference commit to the most recent Time going forward
  • 24. So, what is HEAD? • Areference to the commit most recent • (in most cases – not always true!) Time going forward
  • 25. So, what is MASTER? • • The main branch in your project Doesn’t have to be called master, but almost always is! Time going forward
  • 26. Key Concepts: Branching off of the master branch • The start of a branch points to specific commit When you want to make any changes to your project you make a new branch based on commit a • a
  • 27. Key Concepts: branch Branching off of the master Time going forward
  • 28. aster Key Concepts: Merging • Once you’re done with your feature, you merge it back into Time going forward
  • 29. Key Concepts: How do you make a commit anyway? • There are a lot of ‘states’ and ‘places’ a file can be Local on your computer: the ‘working directory’ When a file is ready to be put in a commit you add it onto the ‘index’ or ‘staging’ • • • Staging is the new preferred term – but you can see both ‘index’and ‘staging’ being used
  • 30. Key Concepts: How do you make anyway? a commit • The process: • • Make some changes to a file Use the ‘git add’ command to put the file onto the staging environment Use the ‘git commit’ command to create a new commit’ •
  • 31. Key Concepts: anyway? How do you make a commit Time going forward
  • 32. Key Concepts: anyway? How do you make a commit Time going forward
  • 33. 4 What is GitHub?
  • 34. What is GitHub? • www.github.com • Largest web-based hosting service git repository • Aka, hosts ‘remote repositories’ • Allows for code collaboration with anyone online Adds extra functionality on top of git• • UI, documentation, bug tracking, feature requests, pull requests, and more! Octocat!
  • 35. What is GitHub? • • Founded in 2008 Also has an Enterprise for businesses edition Octocat!
  • 37. Additional Resources • Official git site and tutorial: https://git-scm.com/ GitHub guides: https://guides.github.com/ Command cheatsheet: https://training.github.com/kit/ downloads/github-git-cheat-sheet.pdf Interactive git tutorial: https://try.github.io/levels/1/challenges/1 Visual/interactive cheatsheet: http://ndpsoftware.com/git-cheatsheet.html • • • •