SlideShare a Scribd company logo
Introduction
to GIT & GIThub
Presented By : Ritesh Kumar
Topics to be discussed
Git & Github Introduction
GIT & Github Difference
A little on VCS
GIT Terminology & GIT
commands and live demo
GIT flow
GIT installation & Account on
GIT?
GIT behind the scenes
Branches in GIT
Diff Stash & Tags
Rebase & Reflog
1
2
3
4
6
7
8
10
9
Getting started with Github
11
5
GIT & Github
Introduction
→ Git is a version control system that allows you to track changes to your
files and collaborate with others.
→ It is used to manage the history of your code and to merge changes
from different branches.
What does Git do?
● Manage projects with Repositories
● Clone a project to work on a local copy
● Control and track changes with Staging and Committing
● Branch and Merge to allow for work on different parts
and versions of a project
● Pull the latest version of the project to a local copy
● Push local updates to the main project
GIT & Github
Difference
GIT
Git is a version control system that is used to
track changes to your files. It is a free and open-
source software that is available for Windows,
macOS, and Linux. Remember, GIT is a software
and can be installed on your computer.
Github
Github is a web-based hosting service for Git
repositories. Github is an online platform that
allows you to store and share your code with
others. It is a popular platform for developers to
collaborate on projects and to share code. It is
not that Github is the only provider of Git
repositories, but it is one of the most popular
ones. There are many more like bitbucket,gitlab
etc.
A Little on VCS
VCS ( Version Control System)
Version control systems are used to manage the history of your code.
Version control systems are essential for software development
Consider version control as a checkpoint in game. You can move to any time in the game and
you can always go back to the previous checkpoint. This is the same concept in software
development.
Before Git became mainstream, version control systems were used by developers to manage
their code. They were called SCCS (Source Code Control System). SCCS was a proprietary
software that was used to manage the history of code. It was expensive and not very user-
friendly. Git was created to replace SCCS and to make version control more accessible and user-
friendly.
Git & Github
Installation
Go to git-scm.com/downloads and download as per your system.
Download and install the latest version of
GitHub Desktop. This will automatically
install Git and keep it upto-date for you.
Link : https://desktop.github.com/
GIT Terminology
Check your git version
To check your git version, you can run the following command:
Terminal window
This command will display the version of git installed on your system. Git is a very stable
software and don’t get any breaking changes in majority of the cases, at least in my experience.
GIT Terminology
Contd. Your config settings
Github has a lot of settings that you can change. You can change your username,
email, and other settings. Whenever you checkpoint your changes, git will add some
information about your such as your username and email to the commit. There is a
git config file that stores all the settings that you have changed.
Let’s setup your email and username in this config file. I would recommend you to create an account on
github and then use the email and username that you have created.
Now you can check your config settings:
Git config --list
This will show you all the settings that you have changed.
GIT Terminology
Contd.
Repository
A repository is a collection of files and directories that are stored together. It is a way to store and manage your code. A
repository is like a folder on your computer, but it is more than just a folder. It can contain other files, folders, and even
other repositories. You can think of a repository as a container that holds all your code.
There is a difference between a software on your system vs tracking a particular folder on your system. At any point you
can run the following command to see the current state of your repository:
GIT Terminology
Creating a repository
Creating a repository is a process of creating a new folder on your system
and initializing it as a git repository. It’s just regular folder to code your
project, you are just asking git to track it. To create a repository, you can use
the following command :
git status command will show you the current state of your repository. git init command will create a new folder
on your system and initialize it as a git repository. This adds a hidden .git folder to your project.
GIT Terminology
Contd.
Complete GIT Flow
When you want to track a new folder, you first use init command
to create a new repository. Then you can use add command to
add the folder to the repository. After that you can use commit
command to save the changes. Finally you can use push
command to push the changes to github. Of course there is more
to it but this is the basic flow.
GIT Terminology
Contd.
GIT Terminology
Contd.
GIT Terminology
Contd.
GIT Terminology
Contd.
GIT behind the
Scenes
Git Snapshots
A git snapshot is a point in time in the history of your code. It represents a specific version of your
code, including all the files and folders that were present at that time. Each snapshot is identified
by a unique hash code, which is a string of characters that represents the contents of the
snapshot.
A snapshot is not an image, it’s just a representation of the code at a specific point in time.
Snapshot is a loose term that is used when git stores information about the code in a locally
stored key-value based database. Everything is stored as an object and each object is identified by
a unique hash code.
GIT behind the
Scenes Contd.
GIT stores data internally using below 3
Objects :
● Commit Objects
● Tree Objects
● Blob Objects
GIT behind the
Scenes Contd.
Commit Object
Each commit in the project is stored in .git
folder in the form of a commit object. A commit
object contains the following information:
● Tree Object
● Parent Commit Object
● Author
● Committer
● Commit Message
Tree Object
Tree Object is a container for all the files and
folders in the project. It contains the following
information:
● File Mode
● File Name
● File Hash
● Parent Tree Object
Everything is stored as key-value pairs in the
tree object. The key is the file name and the
value is the file hash.
Blob Object
Blob Object is present in the
tree object and contains the
actual file content. This is the
place where the file content is
stored.
GIT behind the
Scenes Contd.
Helpful Commands to view Commits,tree,Blob
Here are some helpful commands that you can use to explore the git internals:
git show -s --pretty=raw <commit-hash>
[This will show all the information of the particular commit Id]
Commit IDs can be obtained using below commands
:
→ git log –oneline
[ Grab tree id from the above command and use it in the following command to get the tree object:]
git ls-tree <tree-id>
[Grab tree id from the above command and use it in the following command to get the blob object:]
git show <blob-id>
[Grab tree id from the above command and use it in the following command to get the commit object:]
git cat-file -p <commit-id>

More Related Content

Similar to GIT & Github introduction for beginners (20)

PPTX
Git 101
jayrparro
 
PPTX
Introduction to git hub
Naveen Pandey
 
ODP
Git presentation
Vikas Yaligar
 
PPTX
Introduction to git & GitHub
Poornachandrakashi
 
PDF
GIT_Overview.
Mithilesh Singh
 
PDF
Introduction to Git
Yan Vugenfirer
 
PDF
Rc094 010d-git 2 - desconocido
Luis Bertel
 
PPT
Git introduction
satyendrajaladi
 
PPTX
Version controll.pptx
Md. Main Uddin Rony
 
PPTX
Version Control System-git status,git add,git commit,git log.pptx
ChayapathiAR
 
PPTX
Git.pptx
PalashIMS
 
PDF
Mini git tutorial
Cristian Lucchesi
 
PPTX
Git and github
Teodora Ahkozidou
 
PPTX
Git&GitHub.pptx
KondiVenkatesh1
 
PPTX
Version Control with Git
Sahil Agarwal
 
KEY
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
PPT
GIT-FirstPart.ppt
ssusered2ec2
 
PPTX
1-Intro to VC & GIT PDF.pptx
HuthaifaAlmaqrami1
 
PPTX
github_gyan.pptx
AyushSingh931502
 
PDF
Version Control System - Git
Carlo Bernaschina
 
Git 101
jayrparro
 
Introduction to git hub
Naveen Pandey
 
Git presentation
Vikas Yaligar
 
Introduction to git & GitHub
Poornachandrakashi
 
GIT_Overview.
Mithilesh Singh
 
Introduction to Git
Yan Vugenfirer
 
Rc094 010d-git 2 - desconocido
Luis Bertel
 
Git introduction
satyendrajaladi
 
Version controll.pptx
Md. Main Uddin Rony
 
Version Control System-git status,git add,git commit,git log.pptx
ChayapathiAR
 
Git.pptx
PalashIMS
 
Mini git tutorial
Cristian Lucchesi
 
Git and github
Teodora Ahkozidou
 
Git&GitHub.pptx
KondiVenkatesh1
 
Version Control with Git
Sahil Agarwal
 
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
GIT-FirstPart.ppt
ssusered2ec2
 
1-Intro to VC & GIT PDF.pptx
HuthaifaAlmaqrami1
 
github_gyan.pptx
AyushSingh931502
 
Version Control System - Git
Carlo Bernaschina
 

Recently uploaded (20)

PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
“Scaling i.MX Applications Processors’ Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Ad

GIT & Github introduction for beginners

  • 1. Introduction to GIT & GIThub Presented By : Ritesh Kumar
  • 2. Topics to be discussed Git & Github Introduction GIT & Github Difference A little on VCS GIT Terminology & GIT commands and live demo GIT flow GIT installation & Account on GIT? GIT behind the scenes Branches in GIT Diff Stash & Tags Rebase & Reflog 1 2 3 4 6 7 8 10 9 Getting started with Github 11 5
  • 3. GIT & Github Introduction → Git is a version control system that allows you to track changes to your files and collaborate with others. → It is used to manage the history of your code and to merge changes from different branches. What does Git do? ● Manage projects with Repositories ● Clone a project to work on a local copy ● Control and track changes with Staging and Committing ● Branch and Merge to allow for work on different parts and versions of a project ● Pull the latest version of the project to a local copy ● Push local updates to the main project
  • 4. GIT & Github Difference GIT Git is a version control system that is used to track changes to your files. It is a free and open- source software that is available for Windows, macOS, and Linux. Remember, GIT is a software and can be installed on your computer. Github Github is a web-based hosting service for Git repositories. Github is an online platform that allows you to store and share your code with others. It is a popular platform for developers to collaborate on projects and to share code. It is not that Github is the only provider of Git repositories, but it is one of the most popular ones. There are many more like bitbucket,gitlab etc.
  • 5. A Little on VCS VCS ( Version Control System) Version control systems are used to manage the history of your code. Version control systems are essential for software development Consider version control as a checkpoint in game. You can move to any time in the game and you can always go back to the previous checkpoint. This is the same concept in software development. Before Git became mainstream, version control systems were used by developers to manage their code. They were called SCCS (Source Code Control System). SCCS was a proprietary software that was used to manage the history of code. It was expensive and not very user- friendly. Git was created to replace SCCS and to make version control more accessible and user- friendly.
  • 6. Git & Github Installation Go to git-scm.com/downloads and download as per your system. Download and install the latest version of GitHub Desktop. This will automatically install Git and keep it upto-date for you. Link : https://desktop.github.com/
  • 7. GIT Terminology Check your git version To check your git version, you can run the following command: Terminal window This command will display the version of git installed on your system. Git is a very stable software and don’t get any breaking changes in majority of the cases, at least in my experience.
  • 8. GIT Terminology Contd. Your config settings Github has a lot of settings that you can change. You can change your username, email, and other settings. Whenever you checkpoint your changes, git will add some information about your such as your username and email to the commit. There is a git config file that stores all the settings that you have changed. Let’s setup your email and username in this config file. I would recommend you to create an account on github and then use the email and username that you have created. Now you can check your config settings: Git config --list This will show you all the settings that you have changed.
  • 9. GIT Terminology Contd. Repository A repository is a collection of files and directories that are stored together. It is a way to store and manage your code. A repository is like a folder on your computer, but it is more than just a folder. It can contain other files, folders, and even other repositories. You can think of a repository as a container that holds all your code. There is a difference between a software on your system vs tracking a particular folder on your system. At any point you can run the following command to see the current state of your repository:
  • 10. GIT Terminology Creating a repository Creating a repository is a process of creating a new folder on your system and initializing it as a git repository. It’s just regular folder to code your project, you are just asking git to track it. To create a repository, you can use the following command : git status command will show you the current state of your repository. git init command will create a new folder on your system and initialize it as a git repository. This adds a hidden .git folder to your project.
  • 12. Complete GIT Flow When you want to track a new folder, you first use init command to create a new repository. Then you can use add command to add the folder to the repository. After that you can use commit command to save the changes. Finally you can use push command to push the changes to github. Of course there is more to it but this is the basic flow.
  • 17. GIT behind the Scenes Git Snapshots A git snapshot is a point in time in the history of your code. It represents a specific version of your code, including all the files and folders that were present at that time. Each snapshot is identified by a unique hash code, which is a string of characters that represents the contents of the snapshot. A snapshot is not an image, it’s just a representation of the code at a specific point in time. Snapshot is a loose term that is used when git stores information about the code in a locally stored key-value based database. Everything is stored as an object and each object is identified by a unique hash code.
  • 18. GIT behind the Scenes Contd. GIT stores data internally using below 3 Objects : ● Commit Objects ● Tree Objects ● Blob Objects
  • 19. GIT behind the Scenes Contd. Commit Object Each commit in the project is stored in .git folder in the form of a commit object. A commit object contains the following information: ● Tree Object ● Parent Commit Object ● Author ● Committer ● Commit Message Tree Object Tree Object is a container for all the files and folders in the project. It contains the following information: ● File Mode ● File Name ● File Hash ● Parent Tree Object Everything is stored as key-value pairs in the tree object. The key is the file name and the value is the file hash. Blob Object Blob Object is present in the tree object and contains the actual file content. This is the place where the file content is stored.
  • 20. GIT behind the Scenes Contd. Helpful Commands to view Commits,tree,Blob Here are some helpful commands that you can use to explore the git internals: git show -s --pretty=raw <commit-hash> [This will show all the information of the particular commit Id] Commit IDs can be obtained using below commands : → git log –oneline [ Grab tree id from the above command and use it in the following command to get the tree object:] git ls-tree <tree-id> [Grab tree id from the above command and use it in the following command to get the blob object:] git show <blob-id> [Grab tree id from the above command and use it in the following command to get the commit object:] git cat-file -p <commit-id>