SlideShare a Scribd company logo
1 of 78
Download to read offline
Git
Understanding




   January 6, 2010




                     Jeff Kunkle
What’s Git?
  Git is a free & open source, distributed version control
 system designed to handle everything from small to very
           large projects with speed and efficiency.


 Every Git clone is a full-fledged repository with complete
history and full revision tracking capabilities, not dependent
   on network access or a central server. Branching and
              merging are fast and easy to do.
Working Directory

      ./


           Rakefile


           init.rb


             lib


              grant.rb
Working Directory

       ./
                          .git
            Rakefile


            init.rb


              lib


               grant.rb


>git init
Working Directory

       ./
                          .git   What’s in here?
            Rakefile


            init.rb


              lib


               grant.rb


>git init
Objects
Git Objects
 header   object_type [content size]0
          content of the file
          can be text
content   can be binary
          can be whatever
                                         Zlib::Deflate
Git Objects
     header   object_type [content size]0
              content of the file
              can be text
    content   can be binary
              can be whatever
                                             Zlib::Deflate

1    Blob     2    Tree            3     Commit      4   Tag
1   Blobs
Working Directory        Git Directory

      ./


           Rakefile


           init.rb


             lib


              grant.rb
Working Directory        Git Directory

       ./


            Rakefile


            init.rb


              lib


               grant.rb

>git add .
>git commit -m “initial commit”
Working Directory        Git Directory

       ./


            Rakefile       blob : 21a307


            init.rb       blob : 644eda


              lib


               grant.rb   blob : a22a24

>git add .
>git commit -m “initial commit”
Working Directory        Git Directory

       ./


            Rakefile       blob : 21a307


            init.rb       blob : 644eda

                                      SHA-1 hashes
              lib
                                      of file content

               grant.rb   blob : a22a24

>git add .
>git commit -m “initial commit”
Blob Content
Blob Content
  %w{ models }.each do |dir|
    path = File.join(File.dirname(__FILE__), 'lib', 'app', dir)
    $LOAD_PATH << path
    ActiveSupport::Dependencies.load_paths << path
    ActiveSupport::Dependencies.load_once_paths.delete(path)
  end




>git cat-file -p 644eda
2   Trees
Working Directory        Git Directory

      ./


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib


              grant.rb    blob : a22a24
Working Directory        Git Directory

      ./                   tree : f2eb1e


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib           tree : 523fa4


              grant.rb    blob : a22a24
Tree Content
Tree Content

  100644 blob 21a30738954b6bb164731d822efafa6c89c7bce7! Rakefile
  100644 blob 644eda506db859e011ccbca5a06421ee76782ac7! init.rb
  040000 tree 523fa41bd27fa29a00afb0bef6a10fde75aef501! lib




>git cat-file -p f2eb1e
Working Directory        Git Directory

      ./                   tree : f2eb1e


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib           tree : 523fa4


              grant.rb    blob : a22a24
Working Directory        Git Directory

      ./                   tree : f2eb1e


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib           tree : 523fa4


              grant.rb    blob : a22a24
3   Commits
Working Directory        Git Directory

      ./                   tree : f2eb1e


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib           tree : 523fa4


              grant.rb    blob : a22a24
Working Directory        Git Directory

      ./                   tree : f2eb1e


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib           tree : 523fa4


              grant.rb    blob : a22a24

                         commit : 3848fa
Commit Content
Commit Content

 tree f2eb1e549e7e0d9cd5b7a580e63e9ce79d5a03ae
 author Jeff Kunkle <jkunkle@nearinfinity.com> 1261341813 -0500
 committer Jeff Kunkle <jkunkle@nearinfinity.com> 1261341813 -0500

 initial commit

                                                    first commit



>git cat-file -p 3848fa
Working Directory        Git Directory

      ./                   tree : f2eb1e


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib           tree : 523fa4


              grant.rb    blob : a22a24

                         commit : 3848fa
Working Directory        Git Directory

      ./                   tree : f2eb1e


           Rakefile        blob : 21a307


           init.rb        blob : 644eda


             lib           tree : 523fa4


              grant.rb    blob : a22a24

                         commit : 3848fa
Commit Content
tree ac451e549e7e0d9cd5b7a580e63e9ce79d5b45a1
parent 3848fa7e91490a99b77590ff1385c4b3eebb3de3
author Jeff Kunkle <jkunkle@nearinfinity.com> 1261351813 -0500
committer Jeff Kunkle <jkunkle@nearinfinity.com> 1261351813 -0500

second commit

                                                   next commit
4   Tags
./                  tree : f2eb1e


     Rakefile        blob : 21a307


     init.rb        blob : 644eda


       lib          tree : 523fa4


        grant.rb    blob : a22a24

                   commit : 3848fa
./                  tree : f2eb1e


            Rakefile        blob : 21a307


            init.rb        blob : 644eda


              lib          tree : 523fa4


               grant.rb    blob : a22a24

                          commit : 3848fa

                            tag : e9eff3
>git tag -a v1.0
Tag Content
Tag Content
 object 3848fa7e91490a99b77590ff1385c4b3eebb3de3
 type commit
 tag v1.0
 tagger Jeff Kunkle <jkunkle@ni.com> Tue Dec 29 21:02:04 2009 -0500

 version 1.0




>git cat-file -p v1.0
./                  tree : f2eb1e


            Rakefile        blob : 21a307


            init.rb        blob : 644eda


              lib          tree : 523fa4


               grant.rb    blob : a22a24

                          commit : 3848fa

                            tag : e9eff3
>git tag -a v1.0
./                  tree : f2eb1e


            Rakefile        blob : 21a307


            init.rb        blob : 644eda


              lib          tree : 523fa4


               grant.rb    blob : a22a24

                          commit : 3848fa

                            tag : e9eff3
>git tag -a v1.0
References
Basic Data Model
        tag


       commit


        tree


        blob
Basic Data Model
        tag


       commit
                Immutable
                Git Objects
        tree


        blob
Basic Data Model
          tag


branch   commit
                  Immutable
                  Git Objects
          tree


          blob
Basic Data Model
          tag


branch   commit
                  Immutable
                  Git Objects
          tree


          blob
Basic Data Model
HEAD      tag


branch   commit
                  Immutable
                  Git Objects
          tree


          blob
Basic Data Model
  HEAD        tag


  branch     commit
                      Immutable
                      Git Objects
 Mutable      tree
References
              blob
Working Directory

      ./


           Rakefile


           init.rb


             lib


              grant.rb
HEAD

branch   tag

commit

 tree    blob

 tree    blob

 blob
HEAD             HEAD

  branch   tag     branch

 commit           commit

   tree    blob     tree

   tree    blob     tree

   blob             blob


>git commit -a lib/grant.rb
HEAD             HEAD     HEAD

  branch   tag     branch   branch

 commit           commit    commit

   tree    blob     tree     tree    blob

   tree    blob     tree             blob

   blob             blob


>git commit -a Rakefile init.rb
Branches
branch   branch


commit


 tree     C1


 blob
master




C     C
master




  C     C




       idea

>git checkout -b idea
master




  C     C


                C




               idea

>git commit
master




  C     C


                C




               idea

>git checkout master
master




  C     C             C


                C




               idea

>git commit
bug

      master




  C     C             C


                C




               idea

>git checkout -b bug
bug

      master

                          C


  C     C             C


                C




               idea

>git commit
bug

      master

                          C


  C     C             C


                C




               idea

>git commit
     checkout master
bug

      master

                          C


  C     C             C


                C




               idea

>git commitbug
     merge
bug

                            master

                      C


  C    C          C           C


            C




           idea

>git commitbug
     merge
bug

                            master

                      C


  C    C          C           C


            C




           idea

>git commitbug bug
     branch
     merge -d
bug

                            master

                      C


  C    C          C           C


            C




           idea

>git commitbugidea
     checkout
     branch
     merge -d bug
bug

                           master

                     C


  C    C       C             C


           C                         C




                                    idea

>git commitbugidea
     checkout
     branch
     merge -d bug
bug

                           master

                     C


  C    C       C             C


           C                        C    C




                                        idea

>git commitbugidea
     checkout
     branch
     merge -d bug
bug

                          master

                      C


  C   C       C             C


          C                        C    C




                                       idea

>git commitbugidea
     checkout bug
     branch
     merge -dmaster
bug

                           master

                       C


  C    C       C             C


           C                        C    C




                                        idea

>git commitbugidea
     checkout
     branch -dmaster
     merge ideabug
bug

                                          master

                       C


  C    C       C           C                C


           C                   C    C




                                   idea

>git commitbugidea
     checkout
     branch -dmaster
     merge ideabug
bug

                                          master

                       C


  C    C       C           C                C


           C                   C    C




                                   idea

>git commitbugidea
     checkout idea
     branch -dmaster
     merge ideabug
Recommendations
Starting new project?
Starting new project?

           Use Git
Using SVN or CVS?
Using SVN or CVS?

   Switch to Git
Using Team Studio?
Using Team Studio?

   Maybe switch to Git
Using MKS?
Using MKS?

   Switch to Git
      or CVS, or Subversion, or anything else
References



Good   Better                             Best
                *most diagrams in this presentation are based on Git internals

More Related Content

Recently uploaded

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 

Recently uploaded (20)

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 

Understanding Git Internals

  • 1. Git Understanding January 6, 2010 Jeff Kunkle
  • 2. What’s Git? Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
  • 3. Working Directory ./ Rakefile init.rb lib grant.rb
  • 4. Working Directory ./ .git Rakefile init.rb lib grant.rb >git init
  • 5. Working Directory ./ .git What’s in here? Rakefile init.rb lib grant.rb >git init
  • 7. Git Objects header object_type [content size]0 content of the file can be text content can be binary can be whatever Zlib::Deflate
  • 8. Git Objects header object_type [content size]0 content of the file can be text content can be binary can be whatever Zlib::Deflate 1 Blob 2 Tree 3 Commit 4 Tag
  • 9. 1 Blobs
  • 10. Working Directory Git Directory ./ Rakefile init.rb lib grant.rb
  • 11. Working Directory Git Directory ./ Rakefile init.rb lib grant.rb >git add . >git commit -m “initial commit”
  • 12. Working Directory Git Directory ./ Rakefile blob : 21a307 init.rb blob : 644eda lib grant.rb blob : a22a24 >git add . >git commit -m “initial commit”
  • 13. Working Directory Git Directory ./ Rakefile blob : 21a307 init.rb blob : 644eda SHA-1 hashes lib of file content grant.rb blob : a22a24 >git add . >git commit -m “initial commit”
  • 15. Blob Content %w{ models }.each do |dir| path = File.join(File.dirname(__FILE__), 'lib', 'app', dir) $LOAD_PATH << path ActiveSupport::Dependencies.load_paths << path ActiveSupport::Dependencies.load_once_paths.delete(path) end >git cat-file -p 644eda
  • 16. 2 Trees
  • 17. Working Directory Git Directory ./ Rakefile blob : 21a307 init.rb blob : 644eda lib grant.rb blob : a22a24
  • 18. Working Directory Git Directory ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24
  • 20. Tree Content 100644 blob 21a30738954b6bb164731d822efafa6c89c7bce7! Rakefile 100644 blob 644eda506db859e011ccbca5a06421ee76782ac7! init.rb 040000 tree 523fa41bd27fa29a00afb0bef6a10fde75aef501! lib >git cat-file -p f2eb1e
  • 21. Working Directory Git Directory ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24
  • 22. Working Directory Git Directory ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24
  • 23. 3 Commits
  • 24. Working Directory Git Directory ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24
  • 25. Working Directory Git Directory ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24 commit : 3848fa
  • 27. Commit Content tree f2eb1e549e7e0d9cd5b7a580e63e9ce79d5a03ae author Jeff Kunkle <jkunkle@nearinfinity.com> 1261341813 -0500 committer Jeff Kunkle <jkunkle@nearinfinity.com> 1261341813 -0500 initial commit first commit >git cat-file -p 3848fa
  • 28. Working Directory Git Directory ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24 commit : 3848fa
  • 29. Working Directory Git Directory ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24 commit : 3848fa
  • 30. Commit Content tree ac451e549e7e0d9cd5b7a580e63e9ce79d5b45a1 parent 3848fa7e91490a99b77590ff1385c4b3eebb3de3 author Jeff Kunkle <jkunkle@nearinfinity.com> 1261351813 -0500 committer Jeff Kunkle <jkunkle@nearinfinity.com> 1261351813 -0500 second commit next commit
  • 31. 4 Tags
  • 32. ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24 commit : 3848fa
  • 33. ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24 commit : 3848fa tag : e9eff3 >git tag -a v1.0
  • 35. Tag Content object 3848fa7e91490a99b77590ff1385c4b3eebb3de3 type commit tag v1.0 tagger Jeff Kunkle <jkunkle@ni.com> Tue Dec 29 21:02:04 2009 -0500 version 1.0 >git cat-file -p v1.0
  • 36. ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24 commit : 3848fa tag : e9eff3 >git tag -a v1.0
  • 37. ./ tree : f2eb1e Rakefile blob : 21a307 init.rb blob : 644eda lib tree : 523fa4 grant.rb blob : a22a24 commit : 3848fa tag : e9eff3 >git tag -a v1.0
  • 39. Basic Data Model tag commit tree blob
  • 40. Basic Data Model tag commit Immutable Git Objects tree blob
  • 41. Basic Data Model tag branch commit Immutable Git Objects tree blob
  • 42. Basic Data Model tag branch commit Immutable Git Objects tree blob
  • 43. Basic Data Model HEAD tag branch commit Immutable Git Objects tree blob
  • 44. Basic Data Model HEAD tag branch commit Immutable Git Objects Mutable tree References blob
  • 45. Working Directory ./ Rakefile init.rb lib grant.rb
  • 46. HEAD branch tag commit tree blob tree blob blob
  • 47. HEAD HEAD branch tag branch commit commit tree blob tree tree blob tree blob blob >git commit -a lib/grant.rb
  • 48. HEAD HEAD HEAD branch tag branch branch commit commit commit tree blob tree tree blob tree blob tree blob blob blob >git commit -a Rakefile init.rb
  • 50. branch branch commit tree C1 blob
  • 51. master C C
  • 52. master C C idea >git checkout -b idea
  • 53. master C C C idea >git commit
  • 54. master C C C idea >git checkout master
  • 55. master C C C C idea >git commit
  • 56. bug master C C C C idea >git checkout -b bug
  • 57. bug master C C C C C idea >git commit
  • 58. bug master C C C C C idea >git commit checkout master
  • 59. bug master C C C C C idea >git commitbug merge
  • 60. bug master C C C C C C idea >git commitbug merge
  • 61. bug master C C C C C C idea >git commitbug bug branch merge -d
  • 62. bug master C C C C C C idea >git commitbugidea checkout branch merge -d bug
  • 63. bug master C C C C C C C idea >git commitbugidea checkout branch merge -d bug
  • 64. bug master C C C C C C C C idea >git commitbugidea checkout branch merge -d bug
  • 65. bug master C C C C C C C C idea >git commitbugidea checkout bug branch merge -dmaster
  • 66. bug master C C C C C C C C idea >git commitbugidea checkout branch -dmaster merge ideabug
  • 67. bug master C C C C C C C C C idea >git commitbugidea checkout branch -dmaster merge ideabug
  • 68. bug master C C C C C C C C C idea >git commitbugidea checkout idea branch -dmaster merge ideabug
  • 72. Using SVN or CVS?
  • 73. Using SVN or CVS? Switch to Git
  • 75. Using Team Studio? Maybe switch to Git
  • 77. Using MKS? Switch to Git or CVS, or Subversion, or anything else
  • 78. References Good Better Best *most diagrams in this presentation are based on Git internals