All chapters in this track
- 011. The Mental Model
- 022. Essential Setup
- 033. Core Daily Workflow
- 044. Branching
- 055. Merging & Conflict Resolution
- 066. Rebasing
- 077. Remote Repositories
- 088. Stashing
- 099. Undoing Things
- 1010. Tagging & Versioning
- 1111. Cherry-Pick
- 1212. Git Bisect & Blame
- 1313. Git Hooks
- 1414. Submodules
- 1515. Team Workflows
- 1616. Power Commands & Aliases
- 1717. Reflog: The Safety Net
- 1818. Practice Tasks
- 19Quick Reference Cheatsheet
Chapter 1 of 19
1. The Mental Model
Git has three local areas and one remote:
Working Directory → Staging Area (Index) → Local Repo → Remote Repo
(your files) (git add) (git commit) (git push)
| Area | What lives here |
|---|---|
| Working Directory | Files you're actively editing |
| Staging Area | Snapshot of changes you've selected for the next commit |
| Local Repository | Full project history (.git/ folder) |
| Remote Repository | Shared copy on GitHub/GitLab/Bitbucket |
Key insight: git add does NOT commit. It stages. You choose exactly what goes into each commit.
Every commit is a snapshot, not a diff. Git stores complete file states, then uses delta compression internally.