SlideShare a Scribd company logo
Git and Github Fundamentals
What is Git?
● Git is an Open Source Distributed
Version Control System (VCS).
● Git was developed by Linus Torvalds in 2005.
● The same person who has developed
Linux Operating System.
What is Version Control System (VCS)
● 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.
● For an Example: You have created an App which is on 1.0 version. Suppose you
want to add a feature and so the App is upgraded to 1.1 version.
● But after few days the app is crashing because of the feature. So now you want to
rollback to 1.0 version.
● So here VCS comes into picture. You can track all the changes to file made from
particular checkpoint (commit).
What is Github?
● GitHub is a code hosting platform for version control and
collaboration. It lets you and others work together on projects from
anywhere.
● Other Alternatives are: Gitlab, Bit-Bucket
Git Commands
● git --version
● git init
● git add
● git commit
● git status
● git diff
● git log
● git clone
● git remote
● git push
● git pull
● git branch
● git checkout
● git merge
git --version
● git --version - Returns the version of the git
installed on the machine.
git init
● git init - Creates an empty Git repository or
reinitialize the existing one.
git add
● git add [filename] - Add file contents to staging
area
● git add . - Add all the changed files to staging
area.
○ Staging Area - Git knows what files are changed,
but doesn’t know why changed.
git commit
● git commit -m “commit message” - Create a
new commit containing the current contents of the
index and the given log message describing the
changes.
git status
● git status - Show the working tree status.
○ Gives the list of files changed
git diff
● git diff - Show changes between commits,
commit and working tree, etc
○ git diff [filename] - Shows the content
changed in file after last commit.
git log
● git log - Shows the commit logs.
git clone
● git clone - Clone a repository into a new
directory.
git remote
● git remote - Adds a remote named <name> for
the repository at <url>
○ git remote add origin [url]
git push
● git push - Update remote refs along with
associated objects.
○ git push origin master - update local branch
with remote branch.
git pull
● git pull - Fetch from and integrate with another
repository or a local branch.
○ git pull origin master - Fetch from master
branch of remote repository and integrate with
local branch.
git branch
● git branch - List all the branches
○ git branch [branch-name] - Creates a branch
with name as [branch-name]
git checkout
● git checkout - Switch branches or restore
working tree files.
○ git checkout [branch-name] - Checkout to
[branch-name]
○ Git checkout -b [branch-name] - Creates an
checkout to [branch-name]
git merge
● git merge - Join two or more development
histories together
○ git merge [branch-name] - Merge a [branch-
name] with current branch.
End of Day-1
Merge conflicts
● When two or more people are working on the same file in a repo and are
making changes to it, there are chances that a merge conflict will occur.
● These conflicts needs to be solved manually by deciding which code to keep
and which code to discard.
Hello_world.txt
User 1 User 2
How collaboration works at software companies?
● Suppose, the code for an application is hosted on a platform like GitHub.
● The repository will have 2 branches: Master and Develop
● Master: This contains the code of application that is currently in production.
● Develop: This branch has the latest stable code for the application.
● Now let’s see how an employee works when he/she has to add a new feature
to the application.
Scenario
● Assume that you are an employee working on Instagram Android App.
● And you are asked to work on a feature that allows users to like anyone’s
story.
master develop
master develop
Story-like-feature
Pull Request
● A pull request is opened to propose some new changes or features.
● Once a pull request is opened, someone reviews it and suggests some
changes if needed.
● After few iterations, if everything is good to go then the proposed feature is
merged into master branch.
Practical Demonstration
Visarg
Opening a Pull Request
Raj
Reviewing a Pull Request
Repository Link: https://github.com/DSC-
RNGPIT/git-github-demo
Thank you
Ad

Recommended

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
Git One Day Training Notes
Git One Day Training Notes
glen_a_smith
 
Git and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
 
Git and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 
Intro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Introduction to Git
Introduction to Git
Yan Vugenfirer
 
Git and Github slides.pdf
Git and Github slides.pdf
Tilton2
 
Git and GitHub
Git and GitHub
James Gray
 
Introduction to Git
Introduction to Git
Lukas Fittl
 
Github basics
Github basics
Radoslav Georgiev
 
Git Lab Introduction
Git Lab Introduction
Krunal Doshi
 
Git training v10
Git training v10
Skander Hamza
 
Git real slides
Git real slides
Lucas Couto
 
Starting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Intro to Git and GitHub
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Git & GitHub WorkShop
Git & GitHub WorkShop
SheilaJimenezMorejon
 
Git basic
Git basic
Emran Ul Hadi
 
Version Control & Git
Version Control & Git
Craig Smith
 
Git slides
Git slides
Nanyak S
 
Advanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Introduction to git hub
Introduction to git hub
Naveen Pandey
 
Git and github 101
Git and github 101
Senthilkumar Gopal
 
Grokking opensource with github
Grokking opensource with github
GoogleDeveloperStude4
 
Git basics
Git basics
GHARSALLAH Mohamed
 
Git 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 github
Darren Oakley
 
Formation git
Formation git
Ghariani Tewfik
 
Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 

More Related Content

What's hot (20)

Git and Github slides.pdf
Git and Github slides.pdf
Tilton2
 
Git and GitHub
Git and GitHub
James Gray
 
Introduction to Git
Introduction to Git
Lukas Fittl
 
Github basics
Github basics
Radoslav Georgiev
 
Git Lab Introduction
Git Lab Introduction
Krunal Doshi
 
Git training v10
Git training v10
Skander Hamza
 
Git real slides
Git real slides
Lucas Couto
 
Starting with Git & GitHub
Starting with Git & GitHub
Nicolás Tourné
 
Intro to Git and GitHub
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Git & GitHub WorkShop
Git & GitHub WorkShop
SheilaJimenezMorejon
 
Git basic
Git basic
Emran Ul Hadi
 
Version Control & Git
Version Control & Git
Craig Smith
 
Git slides
Git slides
Nanyak S
 
Advanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Introduction to git hub
Introduction to git hub
Naveen Pandey
 
Git and github 101
Git and github 101
Senthilkumar Gopal
 
Grokking opensource with github
Grokking opensource with github
GoogleDeveloperStude4
 
Git basics
Git basics
GHARSALLAH Mohamed
 
Git 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 github
Darren Oakley
 

Similar to Git and github fundamentals (20)

Formation git
Formation git
Ghariani Tewfik
 
Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Git for standalone use
Git for standalone use
Ikuru Kanuma
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
AbhijitNarayan2
 
GIT_Overview.
GIT_Overview.
Mithilesh Singh
 
Git Basics
Git Basics
Ryan Condron
 
Git Session 2K23.pptx
Git Session 2K23.pptx
Eshaan35
 
GIT
GIT
Binu Paul
 
Git & Github
Git & Github
Aman Lalpuria
 
Git tech talk
Git tech talk
razasayed
 
Git
Git
Amjad Mahfoud
 
introduction in version control system
introduction in version control system
Biga Gaber
 
GDSC Git event 2023.pptx
GDSC Git event 2023.pptx
fsxflyer789Productio
 
Version control and GIT Primer
Version control and GIT Primer
saadulde
 
Git introduction
Git introduction
satyendrajaladi
 
Git and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPB
AmaraCostachiu
 
Git & GitLab
Git & GitLab
Gaurav Wable
 
git & git hub course in information retrieval .pptx
git & git hub course in information retrieval .pptx
AmirHosseinGhasemi9
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
WordCamp Harare
 
Git and GitHub
Git and GitHub
Priya Nayak
 
Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Git for standalone use
Git for standalone use
Ikuru Kanuma
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
AbhijitNarayan2
 
Git Session 2K23.pptx
Git Session 2K23.pptx
Eshaan35
 
Git tech talk
Git tech talk
razasayed
 
introduction in version control system
introduction in version control system
Biga Gaber
 
Version control and GIT Primer
Version control and GIT Primer
saadulde
 
Git and GitHub Workshop of GDG on Campus UNSTPB
Git and GitHub Workshop of GDG on Campus UNSTPB
AmaraCostachiu
 
git & git hub course in information retrieval .pptx
git & git hub course in information retrieval .pptx
AmirHosseinGhasemi9
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
WordCamp Harare
 
Ad

Recently uploaded (20)

Q1_TLE 8_Week 1- Day 1 tools and equipment
Q1_TLE 8_Week 1- Day 1 tools and equipment
clairenotado3
 
List View Components in Odoo 18 - Odoo Slides
List View Components in Odoo 18 - Odoo Slides
Celine George
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
LDMMIA Shop & Student News Summer Solstice 25
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
AndrewBorisenko3
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
INDUCTIVE EFFECT slide for first prof pharamacy students
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
June 2025 Progress Update With Board Call_In process.pptx
June 2025 Progress Update With Board Call_In process.pptx
International Society of Service Innovation Professionals
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
Photo chemistry Power Point Presentation
Photo chemistry Power Point Presentation
mprpgcwa2024
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
Hurricane Helene Application Documents Checklists
Hurricane Helene Application Documents Checklists
Mebane Rash
 
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
How to Manage Different Customer Addresses in Odoo 18 Accounting
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
Q1_TLE 8_Week 1- Day 1 tools and equipment
Q1_TLE 8_Week 1- Day 1 tools and equipment
clairenotado3
 
List View Components in Odoo 18 - Odoo Slides
List View Components in Odoo 18 - Odoo Slides
Celine George
 
Gladiolous Cultivation practices by AKL.pdf
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
How to use search fetch method in Odoo 18
How to use search fetch method in Odoo 18
Celine George
 
LDMMIA Shop & Student News Summer Solstice 25
LDMMIA Shop & Student News Summer Solstice 25
LDM & Mia eStudios
 
VCE Literature Section A Exam Response Guide
VCE Literature Section A Exam Response Guide
jpinnuck
 
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
CRYPTO TRADING COURSE BY FINANCEWORLD.IO
AndrewBorisenko3
 
K12 Tableau User Group virtual event June 18, 2025
K12 Tableau User Group virtual event June 18, 2025
dogden2
 
INDUCTIVE EFFECT slide for first prof pharamacy students
INDUCTIVE EFFECT slide for first prof pharamacy students
SHABNAM FAIZ
 
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
OBSESSIVE COMPULSIVE DISORDER.pptx IN 5TH SEMESTER B.SC NURSING, 2ND YEAR GNM...
parmarjuli1412
 
How to Customize Quotation Layouts in Odoo 18
How to Customize Quotation Layouts in Odoo 18
Celine George
 
NSUMD_M1 Library Orientation_June 11, 2025.pptx
NSUMD_M1 Library Orientation_June 11, 2025.pptx
Julie Sarpy
 
A Visual Introduction to the Prophet Jeremiah
A Visual Introduction to the Prophet Jeremiah
Steve Thomason
 
Photo chemistry Power Point Presentation
Photo chemistry Power Point Presentation
mprpgcwa2024
 
Aprendendo Arquitetura Framework Salesforce - Dia 02
Aprendendo Arquitetura Framework Salesforce - Dia 02
Mauricio Alexandre Silva
 
Hurricane Helene Application Documents Checklists
Hurricane Helene Application Documents Checklists
Mebane Rash
 
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
Filipino 9 Maikling Kwento Ang Ama Panitikang Asiyano
sumadsadjelly121997
 
2025 June Year 9 Presentation: Subject selection.pptx
2025 June Year 9 Presentation: Subject selection.pptx
mansk2
 
How to Manage Different Customer Addresses in Odoo 18 Accounting
How to Manage Different Customer Addresses in Odoo 18 Accounting
Celine George
 
Ad

Git and github fundamentals

  • 1. Git and Github Fundamentals
  • 2. What is Git? ● Git is an Open Source Distributed Version Control System (VCS). ● Git was developed by Linus Torvalds in 2005. ● The same person who has developed Linux Operating System.
  • 3. What is Version Control System (VCS) ● 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. ● For an Example: You have created an App which is on 1.0 version. Suppose you want to add a feature and so the App is upgraded to 1.1 version. ● But after few days the app is crashing because of the feature. So now you want to rollback to 1.0 version. ● So here VCS comes into picture. You can track all the changes to file made from particular checkpoint (commit).
  • 4. What is Github? ● GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. ● Other Alternatives are: Gitlab, Bit-Bucket
  • 5. Git Commands ● git --version ● git init ● git add ● git commit ● git status ● git diff ● git log ● git clone ● git remote ● git push ● git pull ● git branch ● git checkout ● git merge
  • 6. git --version ● git --version - Returns the version of the git installed on the machine.
  • 7. git init ● git init - Creates an empty Git repository or reinitialize the existing one.
  • 8. git add ● git add [filename] - Add file contents to staging area ● git add . - Add all the changed files to staging area. ○ Staging Area - Git knows what files are changed, but doesn’t know why changed.
  • 9. git commit ● git commit -m “commit message” - Create a new commit containing the current contents of the index and the given log message describing the changes.
  • 10. git status ● git status - Show the working tree status. ○ Gives the list of files changed
  • 11. git diff ● git diff - Show changes between commits, commit and working tree, etc ○ git diff [filename] - Shows the content changed in file after last commit.
  • 12. git log ● git log - Shows the commit logs.
  • 13. git clone ● git clone - Clone a repository into a new directory.
  • 14. git remote ● git remote - Adds a remote named <name> for the repository at <url> ○ git remote add origin [url]
  • 15. git push ● git push - Update remote refs along with associated objects. ○ git push origin master - update local branch with remote branch.
  • 16. git pull ● git pull - Fetch from and integrate with another repository or a local branch. ○ git pull origin master - Fetch from master branch of remote repository and integrate with local branch.
  • 17. git branch ● git branch - List all the branches ○ git branch [branch-name] - Creates a branch with name as [branch-name]
  • 18. git checkout ● git checkout - Switch branches or restore working tree files. ○ git checkout [branch-name] - Checkout to [branch-name] ○ Git checkout -b [branch-name] - Creates an checkout to [branch-name]
  • 19. git merge ● git merge - Join two or more development histories together ○ git merge [branch-name] - Merge a [branch- name] with current branch.
  • 21. Merge conflicts ● When two or more people are working on the same file in a repo and are making changes to it, there are chances that a merge conflict will occur. ● These conflicts needs to be solved manually by deciding which code to keep and which code to discard. Hello_world.txt User 1 User 2
  • 22. How collaboration works at software companies? ● Suppose, the code for an application is hosted on a platform like GitHub. ● The repository will have 2 branches: Master and Develop ● Master: This contains the code of application that is currently in production. ● Develop: This branch has the latest stable code for the application. ● Now let’s see how an employee works when he/she has to add a new feature to the application.
  • 23. Scenario ● Assume that you are an employee working on Instagram Android App. ● And you are asked to work on a feature that allows users to like anyone’s story.
  • 25. Pull Request ● A pull request is opened to propose some new changes or features. ● Once a pull request is opened, someone reviews it and suggests some changes if needed. ● After few iterations, if everything is good to go then the proposed feature is merged into master branch.
  • 26. Practical Demonstration Visarg Opening a Pull Request Raj Reviewing a Pull Request