SlideShare a Scribd company logo
1 of 68
Download to read offline
Git & GitHub Workshop
Milind Mishra, Software Engineer
Open Source Contribution is all about Git, GitHub & You!
I’m Milind, I build better Web Experiences ✨
More about me.
• UX/UI Design Intern at iNeuron.ai
• Frontend & DevOps Engineer at Locus Connect
• Research Intern at NYCU Taiwan
• Software Engineer at Startup Hire
• My Portfolio : https://milindmishra.com
What is Git ?
• Keeps track of changes to code
Create file
• Keeps track of changes to code
Create file Add a line
• Keeps track of changes to code
Create file Add a line Delete a line
• Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
• Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Clone repository to
local machines
• Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Make individual changes
• Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Push changes to the server
Merge changes,
resolve conflicts …
• Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Pull changes
• Test changes to code without losing the original.
• Test changes to code without losing the original.
• Test changes to code without losing the original.
Create file Add a line Delete a line
• Reverting back to old versions of code.
Create file Add a line
• Reverting back to old versions of code.
What is Git ?
• Keeps track of changes to code.
• Synchronises code between different people.
• Test changes to code without losing the original.
• Revert back to old versions of code.
git clone
• Makes a copy of a repository
• Stores it on your computer
• A “fork” creates your own copy of
someone else’s repository.
git clone <url>
👨💻
git clone <url>
• Makes a copy of a repository
• Stores it on your computer
• A “fork” creates your own copy of
someone else’s repository.
git clone <url>
👨💻
git add
• Adds a
f
ile to “staging area”
• Tells git to include the
f
ile in the
next revision to the repository.
• To add all changed
f
iles
git add <filename>
👨💻
git add *
• Adds a
f
ile to “staging area”
• Tells git to include the
f
ile in the
next revision to the repository.
• To add all changed
f
iles
git add <filename>
👨💻
git add *
Changes to be committed:
modified: numbers.c
Demo
git diff
git commit
• Saves the changes to repository
as a new version (a “commit”)
• Records a message
• To add all changed
f
iles and
commit in the same step
git commit -m ”message”
👨💻
git commit -am “message”
• Saves the changes to repository
as a new version (a “commit”)
• Records a message
• To add all changed
f
iles and
commit in the same step
git commit -m ”message”
👨💻
git commit -am “message”
Add line
Demo
git status
• Shows current status of the
repository
git status
👨💻
$ git status
Add line
• Shows current status of the
repository
git status
👨💻
$ git status
Add line
On branch master
Your branch is ahead of ‘origin/master’ by 1 commit.
(Use “git push” to publish your local commits)
Demo
git push
• Sends committed changes to
remote repository
• More explicitly, could write
git push
👨💻 Add line
git push origin master
• Sends committed changes to
remote repository
• More explicitly, could write
git push
👨💻 Add line
git push origin master
git push
• Sends committed changes to
remote repository
• More explicitly, could write
git push
👨💻 Add line
git push origin master
git push
Add line
Demo
git pull
• Retrieves changes from remote
repository
git pull
👨💻 Add line
Add line
Remove line
• Retrieves changes from remote
repository
git pull
👨💻 Add line
Add line
Remove line
git pull
• Retrieves changes from remote
repository
git pull
👨💻 Add line
Add line
Remove line
git pull
Remove line
Demo
Merge Con
f
licts
• When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
• When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
Conflict (content): Merge conflict in numbers.c
Automatic merge failed; fix conflicts and then
commit the result.
• When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
{
{
Your changes
Remote changes
Con
f
licting commit
• When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
• When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
Demo
git log
• Shows a history of commits and
messages
git log
👨💻
commit a0dcf982c5db914b22ddb7fba1391f545fd4e266 (HEAD -> main)
Author: Milind Mishra ▲ <milind.mishra4@gmail.com>
Date: Fri Oct 20 14:10:44 2023 +0530
Added
git reset
• To revert back to a previous
commit
• To revert code back to remote
repository version
git reset
👨💻
git reset —hard <commit>
git reset —hard origin/master
• To revert back to a previous
commit
• To revert code back to remote
repository version
git reset
👨💻
git reset —hard <commit>
git reset —hard origin/master
Add line
2346546
Remove line
8976324
Commit hash from “git log”
Branching
Branching
• Branch is a version of the repository.
• Each branch has its own commit history and current version.
git branch
• Shows all branches of code
• Create a branch with
• Switch to (“checkout”) a new
branch with
• Both create and switch to a new
branch by
git branch
git branch <branch_name>
git checkout <branch_name>
git switch <branch_name>
git checkout -b <branch_name>
• Shows all branches of code
• Create a branch with
• Switch to (“checkout”) a new
branch with
• Both create and switch to a new
branch by
git branch
git branch <branch_name>
git checkout <branch_name>
git switch <branch_name>
git checkout -b <branch_name>
👨💻
master
test
git merge
• To merge the branch “branch-
name” with current branch
git merge
git merge <branch_name>
• To merge the branch “branch-
name” with current branch
git merge
git merge <branch_name>
👨💻
master
test
• To merge the branch “branch-
name” with current branch
git merge
git merge <branch_name>
👨💻
master
test
git merge test
Demo
Pull Requests
What is Git ?
• Keeps track of changes to code.
• Synchronises code between different people.
• Test changes to code without losing the original.
• Revert back to old versions of code.
Q/A

More Related Content

Similar to git-presentation.pdf

Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptxEshaan35
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxAbelPhilipJoseph
 
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
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02Gourav Varma
 
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
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hubVenkat Malladi
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03Gourav Varma
 

Similar to git-presentation.pdf (20)

Git presentation
Git presentationGit presentation
Git presentation
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git Session 2K23.pptx
Git Session 2K23.pptxGit Session 2K23.pptx
Git Session 2K23.pptx
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
Git overview
Git overviewGit overview
Git overview
 
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
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
3 Git
3 Git3 Git
3 Git
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying Git
 
Demystifying Git
Demystifying GitDemystifying Git
Demystifying 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
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Github
GithubGithub
Github
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
Git training v10
Git training v10Git training v10
Git training v10
 
Demo
DemoDemo
Demo
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
 

Recently uploaded

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

git-presentation.pdf

  • 1. Git & GitHub Workshop Milind Mishra, Software Engineer Open Source Contribution is all about Git, GitHub & You!
  • 2. I’m Milind, I build better Web Experiences ✨ More about me. • UX/UI Design Intern at iNeuron.ai • Frontend & DevOps Engineer at Locus Connect • Research Intern at NYCU Taiwan • Software Engineer at Startup Hire • My Portfolio : https://milindmishra.com
  • 4. • Keeps track of changes to code Create file
  • 5. • Keeps track of changes to code Create file Add a line
  • 6. • Keeps track of changes to code Create file Add a line Delete a line
  • 7. • Synchronises code between different people 👩💻 👨💻 Git server (lets say git repository)
  • 8. • Synchronises code between different people 👩💻 👨💻 Git server (lets say git repository) Clone repository to local machines
  • 9. • Synchronises code between different people 👩💻 👨💻 Git server (lets say git repository) Make individual changes
  • 10. • Synchronises code between different people 👩💻 👨💻 Git server (lets say git repository) Push changes to the server Merge changes, resolve conflicts …
  • 11. • Synchronises code between different people 👩💻 👨💻 Git server (lets say git repository) Pull changes
  • 12. • Test changes to code without losing the original.
  • 13. • Test changes to code without losing the original.
  • 14. • Test changes to code without losing the original.
  • 15. Create file Add a line Delete a line • Reverting back to old versions of code.
  • 16. Create file Add a line • Reverting back to old versions of code.
  • 17. What is Git ? • Keeps track of changes to code. • Synchronises code between different people. • Test changes to code without losing the original. • Revert back to old versions of code.
  • 19. • Makes a copy of a repository • Stores it on your computer • A “fork” creates your own copy of someone else’s repository. git clone <url> 👨💻 git clone <url>
  • 20. • Makes a copy of a repository • Stores it on your computer • A “fork” creates your own copy of someone else’s repository. git clone <url> 👨💻
  • 22. • Adds a f ile to “staging area” • Tells git to include the f ile in the next revision to the repository. • To add all changed f iles git add <filename> 👨💻 git add *
  • 23. • Adds a f ile to “staging area” • Tells git to include the f ile in the next revision to the repository. • To add all changed f iles git add <filename> 👨💻 git add * Changes to be committed: modified: numbers.c
  • 24. Demo
  • 27. • Saves the changes to repository as a new version (a “commit”) • Records a message • To add all changed f iles and commit in the same step git commit -m ”message” 👨💻 git commit -am “message”
  • 28. • Saves the changes to repository as a new version (a “commit”) • Records a message • To add all changed f iles and commit in the same step git commit -m ”message” 👨💻 git commit -am “message” Add line
  • 29. Demo
  • 31. • Shows current status of the repository git status 👨💻 $ git status Add line
  • 32. • Shows current status of the repository git status 👨💻 $ git status Add line On branch master Your branch is ahead of ‘origin/master’ by 1 commit. (Use “git push” to publish your local commits)
  • 33. Demo
  • 35. • Sends committed changes to remote repository • More explicitly, could write git push 👨💻 Add line git push origin master
  • 36. • Sends committed changes to remote repository • More explicitly, could write git push 👨💻 Add line git push origin master git push
  • 37. • Sends committed changes to remote repository • More explicitly, could write git push 👨💻 Add line git push origin master git push Add line
  • 38. Demo
  • 40. • Retrieves changes from remote repository git pull 👨💻 Add line Add line Remove line
  • 41. • Retrieves changes from remote repository git pull 👨💻 Add line Add line Remove line git pull
  • 42. • Retrieves changes from remote repository git pull 👨💻 Add line Add line Remove line git pull Remove line
  • 43. Demo
  • 45. • When two different commits can’t be automatically merged • Need to be resolved Merge Con f licts 👨💻
  • 46. • When two different commits can’t be automatically merged • Need to be resolved Merge Con f licts 👨💻 git pull Conflict (content): Merge conflict in numbers.c Automatic merge failed; fix conflicts and then commit the result.
  • 47. • When two different commits can’t be automatically merged • Need to be resolved Merge Con f licts 👨💻 git pull { { Your changes Remote changes Con f licting commit
  • 48. • When two different commits can’t be automatically merged • Need to be resolved Merge Con f licts 👨💻 git pull
  • 49. • When two different commits can’t be automatically merged • Need to be resolved Merge Con f licts 👨💻 git pull
  • 50. Demo
  • 52. • Shows a history of commits and messages git log 👨💻 commit a0dcf982c5db914b22ddb7fba1391f545fd4e266 (HEAD -> main) Author: Milind Mishra ▲ <milind.mishra4@gmail.com> Date: Fri Oct 20 14:10:44 2023 +0530 Added
  • 54. • To revert back to a previous commit • To revert code back to remote repository version git reset 👨💻 git reset —hard <commit> git reset —hard origin/master
  • 55. • To revert back to a previous commit • To revert code back to remote repository version git reset 👨💻 git reset —hard <commit> git reset —hard origin/master Add line 2346546 Remove line 8976324 Commit hash from “git log”
  • 57. Branching • Branch is a version of the repository. • Each branch has its own commit history and current version.
  • 59. • Shows all branches of code • Create a branch with • Switch to (“checkout”) a new branch with • Both create and switch to a new branch by git branch git branch <branch_name> git checkout <branch_name> git switch <branch_name> git checkout -b <branch_name>
  • 60. • Shows all branches of code • Create a branch with • Switch to (“checkout”) a new branch with • Both create and switch to a new branch by git branch git branch <branch_name> git checkout <branch_name> git switch <branch_name> git checkout -b <branch_name> 👨💻 master test
  • 62. • To merge the branch “branch- name” with current branch git merge git merge <branch_name>
  • 63. • To merge the branch “branch- name” with current branch git merge git merge <branch_name> 👨💻 master test
  • 64. • To merge the branch “branch- name” with current branch git merge git merge <branch_name> 👨💻 master test git merge test
  • 65. Demo
  • 67. What is Git ? • Keeps track of changes to code. • Synchronises code between different people. • Test changes to code without losing the original. • Revert back to old versions of code.
  • 68. Q/A