SlideShare a Scribd company logo
1 of 94
Git
from Novice to Expert


         goddyzhao<goddy128@gmail.com>
Git
      to Expert


        goddyzhao<goddy128@gmail.com>
Abstract
Abstract

★ Part I > Git Basic
Abstract

★ Part I > Git Basic

★ Part II > Git Internals
Git Basic


Git vs SVN
Git Basic


Git
Git Basic

Don’t think of it in a ‘like (insert
favorite SCM system), but...’
context, but more like a really
interesting file system!

                                by Linus
Git Internals
Git Internals
• >git init
Git Internals
• >git init
• >git add
Git Internals
• >git init
• >git add
• >git commit
Git Internals
• >git init
• >git add
• >git commit
• >git branch
Git Internals
• >git init     • >git tag
• >git add
• >git commit
• >git branch
Git Internals
• >git init     • >git tag
• >git add      • >git merge
• >git commit
• >git branch
Git Internals
• >git init     • >git tag
• >git add      • >git merge
• >git commit   • >git rebase
• >git branch
Git Internals
• >git init     • >git tag
• >git add      • >git merge
• >git commit   • >git rebase
• >git branch   • >git ...
How to Use
    These Git Commands
✓ to Use
How
    These Git Commands
How
 These Git Commands

             Works
How
 These Git Commands

             Works
                      ?
Before That
Soul
Git
Git Object
Git Object
• {Blob}
Git Object
• {Blob}
• {Tree}
Git Object
• {Blob}
• {Tree}
• {Commit}
Git Object
• {Blob}
• {Tree}
• {Commit}
• {Tag}
Git Object
• {Blob}
• {Tree}     imm
• {Commit}
                 uta
                       ble
• {Tag}
{Blob}
{Blob}
{Blob}
         +
{Blob}
         +   Header
{Blob}
         +   Header
{Blob}
         +   Header
{Blob}
         +   Header
{Blob}
         +   Header
{Blob}
File Content            +   Header
{Blob}
File Content +            +   Header
{Blob}
File Content + Header      +   Header
{Blob}
File Content + Header      +   Header
{Blob}
File Content + Header      +   Header




         SHA-1
{Blob}
File Content + Header      +   Header




         SHA-1
{Blob}
File Content + Header          +   Header




         SHA-1



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1          SHA-1: abd9...9



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1          SHA-1: abd9...9



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1          SHA-1: abd9...9



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1          SHA-1: abd9...9



       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1          SHA-1: abd9...9

                           objects/ab
       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1          SHA-1: abd9...9

                           objects/ab
       Zlib::Deflate
{Blob}
File Content + Header




         SHA-1          SHA-1: abd9...9

                           objects/ab
       Zlib::Deflate
                                          d9...9
{Tree}
{Tree}
{Tree}
{Commit}
{Commit}
{Commit}
{Tag}
{Tag}

Reference to Specific Commit
{Tag}

Reference to Specific Commit
Relationships
Relationships
Example
Example
Example
Example
Example
Change base_include.rb
Example
Change base_include.rb
Example
Example
Change init.rb
Example
Change init.rb
Branching & Merging
Branching & Merging
Branching & Merging
Branching & Merging
Branching & Merging
Create a branch
Branching & Merging
Create a branch
Branching & Merging
Branching & Merging

Switch to another branch
Branching & Merging

Switch to another branch
Branching & Merging
Branching & Merging

Merge one branch into another
Branching & Merging

Merge one branch into another
Remote
Remote
Remote
Remote
Remote
Git + SVN
Thanks!

More Related Content

What's hot

What's hot (20)

Github
GithubGithub
Github
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git tutorial II
Git tutorial IIGit tutorial II
Git tutorial II
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
 
Git learning
Git learningGit learning
Git learning
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git commands
Git commandsGit commands
Git commands
 
Git basic
Git basicGit basic
Git basic
 
Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
 
Git basics
Git basicsGit basics
Git basics
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
 
Git github
Git githubGit github
Git github
 
Git-ing out of your git messes - Fluent Conf 2017
Git-ing out of  your git messes - Fluent Conf 2017Git-ing out of  your git messes - Fluent Conf 2017
Git-ing out of your git messes - Fluent Conf 2017
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 

Similar to Git: from Novice to Expert

Similar to Git: from Novice to Expert (20)

Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notes
 
Dive into .git
Dive into .gitDive into .git
Dive into .git
 
Git Real
Git RealGit Real
Git Real
 
Six3 Getting Git
Six3 Getting GitSix3 Getting Git
Six3 Getting Git
 
Git
GitGit
Git
 
Gitlikeapro 2019
Gitlikeapro 2019Gitlikeapro 2019
Gitlikeapro 2019
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Advanced git
Advanced gitAdvanced git
Advanced git
 
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of GitGit Is A State Of Mind - The path to becoming a Master of the mystic art of Git
Git Is A State Of Mind - The path to becoming a Master of the mystic art of Git
 
Git, Fast and Distributed Source Code Management
Git, Fast and Distributed Source Code ManagementGit, Fast and Distributed Source Code Management
Git, Fast and Distributed Source Code Management
 
Git and github introduction
Git and github introductionGit and github introduction
Git and github introduction
 
Git basic
Git basicGit basic
Git basic
 
11 git version control
11 git version control11 git version control
11 git version control
 
That's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETIC
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
 
Demystifying git
Demystifying git Demystifying git
Demystifying git
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Introduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control systemIntroduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control system
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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...
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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 - 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 ...
 

Git: from Novice to Expert

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  42. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  43. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  44. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  45. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  46. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  47. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  48. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  49. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  50. &amp;#x521D;&amp;#x59CB;&amp;#x5316;&amp;#x4E00;&amp;#x4E2A;git&amp;#x5DE5;&amp;#x7A0B;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x65B0;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x7136;&amp;#x540E;&amp;#x67E5;&amp;#x770B; refs/master -&gt; objects/\n
  51. &amp;#x6F14;&amp;#x793A;&amp;#xFF1A;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#x5939;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x518D;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x67E5;&amp;#x770B; objects\n
  52. &amp;#x6F14;&amp;#x793A;&amp;#xFF1A;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#x5939;&amp;#xFF0C;&amp;#x968F;&amp;#x540E;&amp;#x518D;&amp;#x589E;&amp;#x52A0;&amp;#x4E00;&amp;#x4E2A;&amp;#x6587;&amp;#x4EF6;&amp;#xFF0C;&amp;#x67E5;&amp;#x770B; objects\n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n