Key Takeaways
- Git is a Content-Addressable Filesystem: It stores data as snapshots, addressed by SHA-1 hash.
- The Object Model: History is built from Blobs (files), Trees (directories), Commits (snapshots), and Tags.
- The Three Trees: Data moves from Working Directory → Staging Area (Index) → Repository.
- The Index: A binary cache of the working directory that prepares the next commit.
- 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.
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.