Key Takeaways

  1. Git is a Content-Addressable Filesystem: It stores data as snapshots, addressed by SHA-1 hash.
  2. The Object Model: History is built from Blobs (files), Trees (directories), Commits (snapshots), and Tags.
  3. The Three Trees: Data moves from Working Directory → Staging Area (Index) → Repository.
  4. The Index: A binary cache of the working directory that prepares the next commit.
  5. The DAG: Commits form a Directed Acyclic Graph. History is immutable because parent hashes are baked into child commits.

Interactive Flashcards

Test your knowledge by clicking the cards to flip them.

What are the 4 main Git Objects?

Blob, Tree, Commit, Tag

Where is the Staging Area stored?

It is a binary file located at .git/index.

Why is Git history immutable?

Because the parent's SHA-1 hash is part of the child commit's data. Changing a parent changes its hash, breaking the chain.

Cheat Sheet

Command Action Tree Movement
git add <file> Stages a file Working Dir → Index
git commit Saves a snapshot Index → Repository
git checkout <branch> Updates files to match commit Repository → Index → Working Dir
git status Shows differences Compares Working Dir vs Index vs HEAD
cat .git/HEAD Shows current branch ref N/A
git cat-file -p <hash> Prints object content N/A

Next Steps

Now that you understand the Architecture, you are ready to learn how to manipulate it.

Proceed to Module 2: Branching and Merging to learn about recursive merge strategies, rebase vs merge, and conflict resolution.

View Course Glossary