Git - Under the Bonnet

From Training Material
Jump to navigation Jump to search

GIT under the bonnet

  • Object Database
  • SHA1
  • DAG (Directed Acyclical Graph)
  • Index

Object Types


  • store file data


  • ties one or more "blob" objects into a directory structure
  • a tree object can refer to other tree objects, thus creating a directory hierarchy


  • ties such directory hierarchies together into a directed acyclic graph (DAG) of revisions
  • each commit contains the object name of exactly one tree (snapshot of the tree)
  • a commit refers to "parent" commit objects that describe the history of how we arrived at that directory hierarchy


  • symbolically identifies and can be used to sign other objects
  • It contains
    • object name (SHA1, e.g. 232A...)
    • type of another object
    • a symbolic name (e.g. version 1.0.1)
    • optionally, a signature (PGP or GPG)

Directed Acyclic Graph (DAG)

  • Stored as a linked list
  • Uses SHA1 as references
  • One root (object without parents)
  • Multiple parents allowed
    • merge (2 parents)
    • octopus merge (3 or more)

DAG and gitk


DAG and Git objects