Under the Hood of Git
This tutorial is based on the Git Internals Chapter of the Official Git Book.
Learning Objectives
After doing this tutorial you will know how to
- Locate the internal contents of a git repository
- Explain how git uses SHA1 hashes to track content
- Distinguish between the types of objects stored internally by git (blobs, trees and commits)
You will also know how to use internal git commands that do the underlying work behind the git add
, git commit
and git branch
commands:
- Add files and blobs to git’s internal object store using the
hash-object
command
- Add files to git’s staging area using the
write-tree
command
- Create a git commit using the
commit-tree
command
- Create a git branch using the internal
git update-ref
command
Prerequisites
To do these lessons you will need to have installed
- Git
- A command-line terminal program
- A text editor
Lessons
- Preface: Stream Redirection and Piping
- Preface: Hashing
- Git Internals: Hash Objects
- Git Internals: Tree Objects
- Git Internals: Commit Objects
- (optional) Git Internals: Object Storage
- Git Internals: Git References
- Git Internals: Git HEAD Reference